about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-31 13:59:42 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-31 13:59:42 +0000
commitd1601106465f957957e65d8f2ad9b92a1c99a6a1 (patch)
treef68fb8c53bdec771c87473f50ce6a270ae0035fe
parentbf0452b632d1b051de773143a0f9a3c0a84a61e0 (diff)
downloadzsh-d1601106465f957957e65d8f2ad9b92a1c99a6a1.tar.gz
zsh-d1601106465f957957e65d8f2ad9b92a1c99a6a1.tar.xz
zsh-d1601106465f957957e65d8f2ad9b92a1c99a6a1.zip
zsh-workers/7577
-rw-r--r--Doc/Zsh/expn.yo4
-rw-r--r--Src/subst.c5
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;