diff options
-rw-r--r-- | Doc/Zsh/expn.yo | 4 | ||||
-rw-r--r-- | Src/subst.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 429429941..f78c959bb 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -606,8 +606,8 @@ item(tt(%))( Expand all tt(%) escapes in the resulting words in the same way as in prompts (see noderef(Prompt Expansion)). If this flag is given twice, full prompt expansion is done on the resulting words, depending on the -setting of the tt(PROMPT_SUBST) and tt(PROMPT_BANG) options. The -tt(PROMPT_PERCENT) option is temporarily turned on in any case. +setting of the tt(PROMPT_PERCENT), tt(PROMPT_SUBST) and +tt(PROMPT_BANG) options. ) item(tt(X))( With this flag parsing errors occuring with the tt(Q) flag or the diff --git a/Src/subst.c b/Src/subst.c index 70e5c1755..937251b52 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1662,9 +1662,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG]; int opp = opts[PROMPTPERCENT], len; - opts[PROMPTPERCENT] = 1; - if (presc < 2) + if (presc < 2) { + opts[PROMPTPERCENT] = 1; opts[PROMPTSUBST] = opts[PROMPTBANG] = 0; + } if (isarr) { char **ap; |