* PATCH: another double-width character fix
@ 2005-11-21 14:42 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2005-11-21 14:42 UTC (permalink / raw)
To: Zsh hackers list
This came up when inserting a string of double-width characters then
going back and inserting an ordinary character in front. The tortuous
logic intended to ensure we didn't stop in the middle of a double-width
character in the old line meant it went too far along the new line and
tried to output a null.
Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.41
diff -u -r1.41 zle_refresh.c
--- Src/Zle/zle_refresh.c 1 Nov 2005 23:10:22 -0000 1.41
+++ Src/Zle/zle_refresh.c 21 Nov 2005 14:40:38 -0000
@@ -1201,6 +1201,12 @@
/* we can't do any fancy tricks, so just dump the single character
and keep on trying */
#ifdef MULTIBYTE_SUPPORT
+ /*
+ * in case we were tidying up a funny-width character when we
+ * reached the end of the new line...
+ */
+ if (!*nl)
+ break;
do {
#endif
zputc(*nl);
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-21 14:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 14:42 PATCH: another double-width character fix Peter Stephenson
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).