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

Re: Vared Using Spaces for characters



Felix Rosencrantz wrote:
> % var1=fhardy@xxxxxxxx var2=jhardy@xxxxxxxx
> % vared var1 ; vared var2
> fhardy@xxxxxxxx[]
> j              []

This fixes it.  I'm not 100% sure we should be using strlen at all, even
in its wide character guise, instead of the lengths of the input
strings.

Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.21
diff -u -r1.21 zle_refresh.c
--- Src/Zle/zle_refresh.c	25 Feb 2005 15:10:01 -0000	1.21
+++ Src/Zle/zle_refresh.c	4 Mar 2005 21:29:36 -0000
@@ -191,9 +191,15 @@
     }
     for (ln = 0; ln != winh + 1; ln++) {
 	if (nbuf[ln])
-	    *nbuf[ln] = ZWC('\n');
+	{
+	    nbuf[ln][0] = ZWC('\n');
+	    nbuf[ln][1] = ZWC('\0');
+	}
 	if (obuf[ln])
-	    *obuf[ln] = ZWC('\n');
+	{
+	    obuf[ln][0] = ZWC('\n');
+	    obuf[ln][0] = ZWC('\0');
+	}
     }
 
     /* TODO currently zsh core is not using widechars */
-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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