Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: terminal prompt escapes



While testing the stuff from my last mail I noticed that `print -P "%s"'
printed a `\210' for me. This was caused by an off-by-one error in 
promptexpand().

Bye
 Sven

--- os/prompt.c	Mon Aug  9 10:40:42 1999
+++ Src/prompt.c	Thu Aug 19 09:07:36 1999
@@ -171,11 +171,13 @@
     *bp = 0;
     if (!ns) {
 	/* If zero, Inpar, Outpar and Nularg should be removed. */
-	for (bp = buf; *bp; bp++) {
+	for (bp = buf; *bp; ) {
 	    if (*bp == Meta)
-		bp++;
+		bp += 2;
 	    else if (*bp == Inpar || *bp == Outpar || *bp == Nularg)
 		chuck(bp);
+	    else
+		bp++;
 	}
     }
     return buf;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author