about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2010-11-25 17:16:27 +0000
committerWayne Davison <wayned@users.sourceforge.net>2010-11-25 17:16:27 +0000
commitd89e55fe0e78e29808c48e7f12003e765195a21e (patch)
tree8b79e2d1e5e8b5955f7c70308943bd36bdd2dc95
parent2b361ad11671444831fef3b04bd610c26c2e19e9 (diff)
downloadzsh-d89e55fe0e78e29808c48e7f12003e765195a21e.tar.gz
zsh-d89e55fe0e78e29808c48e7f12003e765195a21e.tar.xz
zsh-d89e55fe0e78e29808c48e7f12003e765195a21e.zip
Overwrite PROMPT_SP string if it should remain invisible,
even with an upcoming newline.
-rw-r--r--ChangeLog7
-rw-r--r--Src/utils.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index fc91e92c7..7029cde4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-25  Wayne Davison  <wayned@users.sourceforge.net>
+
+	* 28445: Src/utils.c: overwrite PROMPT_SP string if it
+	should remain invisible, even with an upcoming newline.
+
 2010-11-25  Peter Stephenson  <pws@csr.com>
 
 	* users/15580: Completion/Zsh/Function/_zsh-mime-handler,
@@ -13847,5 +13852,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5127 $
+* $Revision: 1.5128 $
 *****************************************************
diff --git a/Src/utils.c b/Src/utils.c
index 2e30c176a..daa753a1f 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1292,9 +1292,10 @@ preprompt(void)
 	countprompt(str, &w, 0, -1);
 	opts[PROMPTPERCENT] = percents;
 	zputs(str, shout);
-	for (w = (int)columns - w - !hasxn; w > 0; w--)
-	    putc(' ', shout);
-	putc('\r', shout);
+	if (hasxn)
+	    fprintf(shout, "%*s\r%*s\r", (int)columns - w, "", w, "");
+	else
+	    fprintf(shout, "%*s\r", (int)columns - w - 1, "");
 	free(str);
     }