about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-03-18 16:03:09 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-03-18 16:03:09 +0000
commitbe2381eb52baa9745c2184a9d2cf6d12d2303241 (patch)
tree818464c738b6106ff0f3f84388be800dab4d18f5
parent9cfc991811c9affc47efec7a58bcf1df16790f53 (diff)
downloadzsh-be2381eb52baa9745c2184a9d2cf6d12d2303241.tar.gz
zsh-be2381eb52baa9745c2184a9d2cf6d12d2303241.tar.xz
zsh-be2381eb52baa9745c2184a9d2cf6d12d2303241.zip
27804: don't hang in isearch if invalid character found
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/zle_hist.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b7d1e8a38..88d2b69d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-18  Peter Stephenson  <pws@csr.com>
+
+	* 27804: Src/Zle/zle_hist.c: don't hang on encountering invalid
+	character in incremental search.
+
 2010-03-17  Peter Stephenson  <pws@csr.com>
 
 	* unposted: Functions/Calendar/calendar: fix embarrassing bug in
@@ -12920,5 +12925,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4935 $
+* $Revision: 1.4936 $
 *****************************************************
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 5b57f4468..241ef419e 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -1454,6 +1454,8 @@ doisearch(char **args, int dir, int pattern)
 	    memset(&mbs, 0, sizeof(mbs));
 	    while (charpos < end_pos) {
 		ret = mb_metacharlenconv_r(zlemetaline + charpos, &wc, &mbs);
+		if (ret <= 0) /* Unrecognised, treat as single char */
+		    ret = 1;
 		if (charpos <= pos && pos < charpos + ret)
 		    isearch_startpos = charcount;
 		charcount++;