diff options
| author | dana <dana@dana.is> | 2026-05-27 22:28:37 -0500 |
|---|---|---|
| committer | dana <dana@dana.is> | 2026-05-27 22:42:51 -0500 |
| commit | c14a702e471a7fc91fbb41ca5c04c1b8bc172110 (patch) | |
| tree | f809734dd1fa1653a851cff281e1d03c679786c4 /Src/Modules | |
| parent | 54602: zformat: add -qQ options to auto-escape %s (diff) | |
| download | zsh-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.c | 10 |
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; } |
