Bash-4.1 distribution source
This commit is contained in:
@@ -77,7 +77,7 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
|
||||
char *string;
|
||||
int seed, count, find_non_zero;
|
||||
{
|
||||
size_t tmp;
|
||||
size_t tmp, len;
|
||||
mbstate_t ps;
|
||||
int point;
|
||||
wchar_t wc;
|
||||
@@ -99,7 +99,10 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
tmp = mbrtowc (&wc, string+point, strlen(string + point), &ps);
|
||||
len = strlen (string + point);
|
||||
if (len == 0)
|
||||
break;
|
||||
tmp = mbrtowc (&wc, string+point, len, &ps);
|
||||
if (MB_INVALIDCH ((size_t)tmp))
|
||||
{
|
||||
/* invalid bytes. assume a byte represents a character */
|
||||
|
||||
Reference in New Issue
Block a user