summaryrefslogtreecommitdiffstats
path: root/Src/Modules
diff options
context:
space:
mode:
authordana <dana@dana.is>2026-05-27 22:28:37 -0500
committerdana <dana@dana.is>2026-05-27 22:42:51 -0500
commitc14a702e471a7fc91fbb41ca5c04c1b8bc172110 (patch)
treef809734dd1fa1653a851cff281e1d03c679786c4 /Src/Modules
parent54602: zformat: add -qQ options to auto-escape %s (diff)
downloadzsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar.gz
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar.bz2
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar.lz
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar.xz
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.tar.zst
zsh-c14a702e471a7fc91fbb41ca5c04c1b8bc172110.zip
unposted: zformat: pass through %) with -q
the behaviour in the original patch was not actually desirable
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/zutil.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index 0367669cf..add055460 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -849,13 +849,9 @@ static char *zformat_substring(char* instr, char **specs, char **outp,
// next char isn't a legal spec char -- unwind, treat the sequence
// literally
if (!testit && (!*s || *s == '%' || *s == ')' || *s == '-' || *s == '.')) {
- // but swallow the % if this is %% or %)
- if (!quote) {
- start += (s - start == 1 && (*s == '%' || *s == ')'));
- // if quoting, only swallow with %). admittedly this is confusing
- } else {
- start += (s - start == 1 && *s == ')');
- }
+ // but swallow the % if no -q and this is %% or %)
+ if (!quote)
+ start += (s - start == 1 && (*s == '%' || *s == ')'));
s = start;
}