summaryrefslogtreecommitdiff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-23 13:50:09 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-23 13:50:09 +0000
commitd9137fd4b6031f0d1640b31779b41dbf742df18d (patch)
tree5daee43fbc9b10d74d8e4c7b2ce953f0be02c7b9 /Src/Zle/complist.c
parent23f6fa7244c24f56b00c1eba2dab0c0178662e18 (diff)
downloadzsh-d9137fd4b6031f0d1640b31779b41dbf742df18d.tar.gz
zsh-d9137fd4b6031f0d1640b31779b41dbf742df18d.zip
20854: more Unicode stuff.
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 748b1fdf7..b0baa490f 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1861,7 +1861,11 @@ msearchpop(int *backp)
static Cmatch **
msearch(Cmatch **ptr, int ins, int back, int rep, int *wrapp)
{
+#ifdef ZLE_UNICODE_SUPPORT
+ char s[MB_CUR_MAX+1];
+#else
char s[2];
+#endif
Cmatch **p, *l = NULL, m;
int x = mcol, y = mline;
int ex, ey, wrap = 0, owrap = (msearchstate & MS_WRAPPED);
@@ -1869,12 +1873,19 @@ msearch(Cmatch **ptr, int ins, int back, int rep, int *wrapp)
msearchpush(ptr, back);
if (ins) {
- /*
- * TODO: probably need to convert back to multibyte character
- * string? Who knows...
- */
- s[0] = lastchar;
- s[1] = '\0';
+#ifdef ZLE_UNICODE_SUPPORT
+ if (lastchar_wide_valid)
+ {
+ int len = wctomb(s, lastchar_wide);
+ if (len < 0)
+ len = 0;
+ s[len] = '\0';
+ } else
+#endif
+ {
+ s[0] = lastchar;
+ s[1] = '\0';
+ }
msearchstr = dyncat(msearchstr, s);
}