summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2006-01-13 09:43:46 +0000
committerWayne Davison <wayned@users.sourceforge.net>2006-01-13 09:43:46 +0000
commit394a6b3567999d25191076ef5155e4e6ad01ac09 (patch)
tree3855b436c10c736e3c81292f8ed1ad45aebf1479 /Src
parent325c9a1de59501ce8412cc8b32913cac30c2ed75 (diff)
downloadzsh-394a6b3567999d25191076ef5155e4e6ad01ac09.tar.gz
zsh-394a6b3567999d25191076ef5155e4e6ad01ac09.tar.xz
zsh-394a6b3567999d25191076ef5155e4e6ad01ac09.zip
A better version of my last change.
Diffstat (limited to 'Src')
-rw-r--r--Src/prompt.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/Src/prompt.c b/Src/prompt.c
index 81ed47a30..8b658883f 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -543,18 +543,10 @@ putpromptchar(int doprint, int endchar)
 			if (ztrftime(bp, t0, tmfmt, tm) >= 0)
 			    break;
 		    }
-		    /* Check if there are any chars to metafy while
-		     * advancing bp to the end of the string. */
-		    for (ss = bp, t0 = 0; *bp; bp++ ) {
-			if (imeta(*bp))
-			    t0++; /* count of Meta chars needed */
-		    }
-		    if (t0) {
-			j = bp - ss; /* unmetafied string length */
-			addbufspc(t0);
-			metafy(bp - j, j, META_NOALLOC);
-			bp += t0;
-		    }
+		    /* There is enough room for this because addbufspc(t0)
+		     * allocates room for t0 * 2 bytes. */
+		    metafy(bp, -1, META_NOALLOC);
+		    bp += strlen(bp);
 		    free(tmbuf);
 		    tmbuf = NULL;
 		    break;