From 78d1939ffd229c8c4ff303bac6d41a08b983e65e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 21 Sep 2006 16:36:53 +0000 Subject: 22753: minor character bugs spotted on Cygwin --- ChangeLog | 6 ++++++ Src/Zle/complist.c | 4 ++-- Src/prompt.c | 3 ++- Src/utils.c | 3 ++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb32b2df1..5934a824d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-21 Peter Stephenson + + * 22753: Src/prompt.c, Src/utils.c, Src/Zle/complist.c: + minor bugs with using characters spotted from warnings on + Cygwin. + 2006-09-20 Peter Stephenson * users/10748: Doc/Zsh/compsys.yo: improve example, make one diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 886b4a685..1152dff7c 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -982,7 +982,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop) len = MB_METACHARLENCONV(p, &cchar); #ifdef MULTIBYTE_SUPPORT if (cchar == WEOF) { - cchar = (wchar_t)p; + cchar = (wchar_t)(*p == Meta ? p[1] ^ 32 : *p); width = 1; } else @@ -995,7 +995,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop) len = MB_METACHARLENCONV(p, &cchar); #ifdef MULTIBYTE_SUPPORT if (cchar == WEOF) - cchar = (wchar_t)p; + cchar = (wchar_t)(*p == Meta ? p[1] ^ 32 : *p); #endif p += len; diff --git a/Src/prompt.c b/Src/prompt.c index fc0c7ea47..b4b55a0ea 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -1130,7 +1130,8 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar) * Normal text: build up a multibyte character. */ char inchar; - wchar_t cc, wcw; + wchar_t cc; + int wcw; /* * careful: string is still metafied (we diff --git a/Src/utils.c b/Src/utils.c index 415e86151..e91baf970 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -2019,9 +2019,10 @@ mod_export int noquery(int purge) { int val = 0; - char c; #ifdef FIONREAD + char c; + ioctl(SHTTY, FIONREAD, (char *)&val); if (purge) { for (; val; val--) -- cgit 1.4.1