diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2006-08-03 15:37:49 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-08-03 15:37:49 +0000 |
commit | 48d6402e65f87427d83a516e5296d677735f0022 (patch) | |
tree | 8879ee181827627d65ac60f3f822f5294c845778 /Src/Zle/complist.c | |
parent | 07f11ba6bf609797f42c1ac768184b359a4e6ad7 (diff) | |
download | zsh-48d6402e65f87427d83a516e5296d677735f0022.tar.gz zsh-48d6402e65f87427d83a516e5296d677735f0022.tar.xz zsh-48d6402e65f87427d83a516e5296d677735f0022.zip |
rationalise mb<->wc conversions to use restartable form
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r-- | Src/Zle/complist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 0bea231c5..8c6937b4a 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -588,6 +588,7 @@ clnicezputs(Listcols colors, char *s, int ml) if (colors) initiscol(colors); + mb_metacharinit(); while (umleft > 0) { size_t cnt = eol ? MB_INVALID : mbrtowc(&cc, uptr, umleft, &mbs); @@ -1964,7 +1965,9 @@ msearch(Cmatch **ptr, int ins, int back, int rep, int *wrapp) #ifdef MULTIBYTE_SUPPORT if (lastchar_wide_valid) { - int len = wctomb(s, lastchar_wide); + mbstate_t mbs; + memset(&mbs, 0, sizeof(mbs)); + int len = wcrtomb(s, lastchar_wide, &mbs); if (len < 0) len = 0; s[len] = '\0'; |