1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-01 08:21:17 +02:00

22124: handle bad multibyte input better

This commit is contained in:
Peter Stephenson 2006-01-06 14:23:00 +00:00
parent d8a851a9a8
commit 94953f70b9
3 changed files with 16 additions and 3 deletions

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

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

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