diff options
-rw-r--r-- | Src/Zle/zle_tricky.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index d89c47b50..fb2af7599 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1911,12 +1911,12 @@ pfxlen(char *s, char *t) #ifdef MULTIBYTE_SUPPORT wchar_t wc; - mbstate_t ps; + mbstate_t mbs; size_t cnt; int lasti = 0; char inc; - memset(&ps, 0, sizeof ps); + memset(&mbs, 0, sizeof mbs); while (*s) { if (*s == Meta) { if (*t != Meta || t[1] != s[1]) @@ -1934,12 +1934,12 @@ pfxlen(char *s, char *t) t++; } - cnt = mbrtowc(&wc, &inc, 1, &ps); - if (cnt == (size_t)-1) { + cnt = mbrtowc(&wc, &inc, 1, &mbs); + if (cnt == MB_INVALID) { /* error */ break; } - if (cnt != (size_t)-2) { + if (cnt != MB_INCOMPLETE) { /* successfully found complete character, record position */ lasti = i; } |