about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2005-09-20 16:33:01 +0000
committerWayne Davison <wayned@users.sourceforge.net>2005-09-20 16:33:01 +0000
commit0945e203239f24faf44aec47eed8a1fd3eadc38e (patch)
tree1370e0803bfaa820403ba3bf3bbf40e3113aec2f /Src
parent29bb2438c0d8a731630ab466a050b0c3bdc82827 (diff)
downloadzsh-0945e203239f24faf44aec47eed8a1fd3eadc38e.tar.gz
zsh-0945e203239f24faf44aec47eed8a1fd3eadc38e.tar.xz
zsh-0945e203239f24faf44aec47eed8a1fd3eadc38e.zip
The PROMPT_SP code now ensures that PROMPT_PERCENT is enabled when
it uses promptexpand() to expand some percent strings. (21739)
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c
index acde33c28..8a7c557f0 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -758,7 +758,11 @@ preprompt(void)
 	/* The PROMPT_SP heuristic will move the prompt down to a new line
 	 * if there was any dangling output on the line (assuming the terminal
 	 * has automatic margins, but we try even if hasam isn't set). */
-	char *str = promptexpand("%B%S#%s%b", 0, NULL, NULL);
+	char *str;
+	int percents = isset(PROMPTPERCENT);
+	opts[PROMPTPERCENT] = 1;
+	str = promptexpand("%B%S#%s%b", 0, NULL, NULL);
+	opts[PROMPTPERCENT] = percents;
 	fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
 	free(str);
     }