summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2007-01-26 19:11:48 +0000
committerWayne Davison <wayned@users.sourceforge.net>2007-01-26 19:11:48 +0000
commit9abddc0ccf9d651347ab1077d62c0df0942262d3 (patch)
tree9a31d526229741d0302c2d1deae64b4a9a823c26
parentf223e9b4ee528d3b6da604c2b0486a9384a88805 (diff)
downloadzsh-9abddc0ccf9d651347ab1077d62c0df0942262d3.tar.gz
zsh-9abddc0ccf9d651347ab1077d62c0df0942262d3.tar.xz
zsh-9abddc0ccf9d651347ab1077d62c0df0942262d3.zip
Fixed the error checking of mbrtowc() since its return vlaue can never
be < 0 -- it returns MB_INVALID, (size_t)-1, which is a positive value.
-rw-r--r--Src/Zle/zle_tricky.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 845f74bc5..72d72d54f 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2589,7 +2589,7 @@ magicspace(char **args)
      * but must be ASCII, so we simply cast the pointer.
      */
     memset(&mbs, 0, sizeof(mbs));
-    if (mbrtowc(zlebangchar, (char *)&bangchar, 1, &mbs) < 0)
+    if (mbrtowc(zlebangchar, (char *)&bangchar, 1, &mbs) == MB_INVALID)
 	return selfinsert(args);
 #else
     zlebangchar[0] = bangchar;