diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2006-01-12 00:51:53 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2006-01-12 00:51:53 +0000 |
commit | f6fefb2db3671e88df1ccd0290a5eeb848f24f4b (patch) | |
tree | 89a1077c27541b03698c89880fa649ed90b1a776 | |
parent | 542797377aabd9af067909fd14af08b1081b250c (diff) | |
download | zsh-f6fefb2db3671e88df1ccd0290a5eeb848f24f4b.tar.gz zsh-f6fefb2db3671e88df1ccd0290a5eeb848f24f4b.tar.xz zsh-f6fefb2db3671e88df1ccd0290a5eeb848f24f4b.zip |
- Use "mbs" for the multi-byte state variable name (for consistency).
- Use the new MB_INVALID and MB_INCOMPLETE defines for the size_t -1 and -2 values (respectively).
-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; } |