zsh-workers
 help / color / mirror / code / Atom feed
* Vared Using Spaces for characters
@ 2005-03-04  3:45 Felix Rosencrantz
  2005-03-04 21:34 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Rosencrantz @ 2005-03-04  3:45 UTC (permalink / raw)
  To: zsh-workers

I'm seeing a problem with running multiple vared  commands on the same
command line with the latest zsh from anonymous cvs.  Tested on both
FC1&3.

Example.  (added [] to show where the cursor is placed).  In this
example I just hit return for each of the vared lines.  It displays
spaces for some of the characters on the second vared, though it
doesn't seem to change the value of the variable
zsh -f
% var1=fhardy@boys.com var2=jhardy@boys.com
% vared var1 ; vared var2
fhardy@boys.com[]
j              []
% vared var2 ; vared var1
jhardy@boys.com[]
f              []
% exit

-FR.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vared Using Spaces for characters
  2005-03-04  3:45 Vared Using Spaces for characters Felix Rosencrantz
@ 2005-03-04 21:34 ` Peter Stephenson
  2005-03-04 22:36   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2005-03-04 21:34 UTC (permalink / raw)
  To: zsh-workers

Felix Rosencrantz wrote:
> % var1=fhardy@boys.com var2=jhardy@boys.com
> % vared var1 ; vared var2
> fhardy@boys.com[]
> 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@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Vared Using Spaces for characters
  2005-03-04 21:34 ` Peter Stephenson
@ 2005-03-04 22:36   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2005-03-04 22:36 UTC (permalink / raw)
  To: zsh-workers

On Mar 4,  9:34pm, Peter Stephenson wrote:
} Subject: Re: Vared Using Spaces for characters
}
} This fixes it.

Uh, really?

} +	{
} +	    obuf[ln][0] = ZWC('\n');
} +	    obuf[ln][0] = ZWC('\0');
} +	}

That second 0 should be a 1 ?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-04 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-04  3:45 Vared Using Spaces for characters Felix Rosencrantz
2005-03-04 21:34 ` Peter Stephenson
2005-03-04 22:36   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).