zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: fix for multibyte counting
@ 2006-06-27 11:55 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2006-06-27 11:55 UTC (permalink / raw)
  To: Zsh hackers list

It's possible to get into an infinite loop with invalid multibyte
characters in mb_metastrlen().

Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.123
diff -u -r1.123 utils.c
--- Src/utils.c	26 Jun 2006 18:17:32 -0000	1.123
+++ Src/utils.c	27 Jun 2006 11:53:19 -0000
@@ -3778,8 +3778,8 @@
 		/* Reset, treat as single character */
 		memset(&mb_shiftstate, 0, sizeof(mb_shiftstate));
 		ptr = laststart + (*laststart == Meta) + 1;
-	    } else
-		laststart = ptr;
+	    }
+	    laststart = ptr;
 	    num++;
 	    num_in_char = 0;
 	}

-- 
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


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-27 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-27 11:55 PATCH: fix for multibyte counting 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).