about summary refs log tree commit diff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-22 13:12:35 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-22 13:12:35 +0000
commitb83f0e229097626fa8e667486c48d7a3139d2e4a (patch)
treedd125c9521986e7a40e4d13a67db90757aee9ad5 /Src/Zle/zle_main.c
parentc8883a5a08e6a9c0fbb088acab11c1ef8788b3d8 (diff)
downloadzsh-b83f0e229097626fa8e667486c48d7a3139d2e4a.tar.gz
zsh-b83f0e229097626fa8e667486c48d7a3139d2e4a.tar.xz
zsh-b83f0e229097626fa8e667486c48d7a3139d2e4a.zip
Andrej: 20838: get ZLE_UNICODE_SUPPORT basically working
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 1f7b7cbfa..f0e34a28a 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -748,10 +748,11 @@ getfullchar(int keytmout)
 mod_export ZLE_INT_T
 getrestchar(int inchar)
 {
-    char cnull = '\0';
+    /* char cnull = '\0'; */
     char buf[MB_CUR_MAX], *ptr;
     wchar_t outchar;
     int ret;
+    mbstate_t ps;
 
     /*
      * We are guaranteed to set a valid wide last character,
@@ -764,7 +765,8 @@ getrestchar(int inchar)
 	return lastchar_wide = WEOF;
 
     /* reset shift state by converting null */
-    mbrtowc(&outchar, &cnull, 1, &ps);
+    /* mbrtowc(&outchar, &cnull, 1, &ps); */
+    memset (&ps, '\0', sizeof (ps));
 
     ptr = buf;
     *ptr++ = inchar;
@@ -785,7 +787,7 @@ getrestchar(int inchar)
 	    return lastchar_wide = WEOF;
 	*ptr++ = inchar;
     }
-    return lastchar_wide = (wint_t)outchar;
+    return lastchar_wide = (ZLE_INT_T)outchar;
 }
 /**/
 #endif