about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-01-06 14:23:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-01-06 14:23:00 +0000
commit94953f70b94e639b8b5563295a780a76c37330ab (patch)
treecdfbf78990e7c05782a2cba7ca33ae1a1804173b
parentd8a851a9a8b29ebf22b2746299697220e200eaa4 (diff)
downloadzsh-94953f70b94e639b8b5563295a780a76c37330ab.tar.gz
zsh-94953f70b94e639b8b5563295a780a76c37330ab.tar.xz
zsh-94953f70b94e639b8b5563295a780a76c37330ab.zip
22124: handle bad multibyte input better
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_hist.c10
-rw-r--r--Src/Zle/zle_misc.c6
3 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index cd66acc43..6908523e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-01-06  Peter Stephenson  <pws@csr.com>
 
+	* 22124: Src/Zle/zle_hist.c, Src/Zle/zle_misc.c: feep()
+	if getrestchar() indicates bad character.
+
 	* 22123: configure.ac, Src/system.h: probe for wcswidth() and
 	assume 1 if not found.
 
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 31fa6ace0..af4529489 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -1107,7 +1107,10 @@ doisearch(char **args, int dir)
 	    } else if (cmd == Th(z_selfinsert)) {
 #ifdef MULTIBYTE_SUPPORT
 		if (!lastchar_wide_valid)
-		    getrestchar(lastchar);
+		    if (getrestchar(lastchar) == WEOF) {
+			handlefeep(zlenoargs);
+			continue;
+		    }
 #else
 		;
 #endif
@@ -1303,7 +1306,10 @@ getvisrchstr(void)
 	    } else {
 #ifdef MULTIBYTE_SUPPORT
 		if (!lastchar_wide_valid)
-		    getrestchar(lastchar);
+		    if (getrestchar(lastchar) == WEOF) {
+			handlefeep(zlenoargs);
+			continue;
+		    }
 #else
 		;
 #endif
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 1cb113a2d..aa8d1058d 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -64,7 +64,8 @@ selfinsert(UNUSED(char **args))
 
 #ifdef MULTIBYTE_SUPPORT
     if (!lastchar_wide_valid)
-	getrestchar(lastchar);
+	if (getrestchar(lastchar) == WEOF)
+	    return 1;
 #endif
     tmp = LASTFULLCHAR;
     doinsert(&tmp, 1);
@@ -1018,6 +1019,9 @@ executenamedcommand(char *prmt)
 #ifdef MULTIBYTE_SUPPORT
 		    if (!lastchar_wide_valid)
 			getrestchar(lastchar);
+		    if (lastchar_wide == WEOF)
+			feep = 1;
+		    else
 #endif
 		    if (ZC_icntrl(LASTFULLCHAR))
 			feep = 1;