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

PATCH: Still more prompt truncation problems



Hoping to sneak this in before PWS posts -dev-20 ...

Index: Src/prompt.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Src/prompt.c,v
retrieving revision 1.13
diff -u -r1.13 prompt.c
--- prompt.c	2000/03/24 09:58:38	1.13
+++ prompt.c	2000/03/24 10:00:24
@@ -768,9 +768,12 @@
 	truncstr = ztrduppfx(ptr, bp - ptr);
 
 	bp = ptr;
+	w = bp - buf;
 	fm++;
 	putpromptchar(doprint, endchar);
+	ptr = buf + w;		/* putpromptchar() may have realloc()'d */
 	*bp = '\0';
+
 	countprompt(ptr, &w, 0, -1);
 	if (w > trunclen) {
 	    /*

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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