]> granicus.if.org Git - mutt/commitdiff
http://thread.gmane.org/gmane.mail.mutt.devel/15710
authorFabian Groffen <grobian@gentoo.org>
Thu, 22 Jul 2010 18:06:33 +0000 (20:06 +0200)
committerFabian Groffen <grobian@gentoo.org>
Thu, 22 Jul 2010 18:06:33 +0000 (20:06 +0200)
Interix doesn't have btowc, but it does have mbtowc.  Linux manpage also
discourages the use of btowc.

regex.c

diff --git a/regex.c b/regex.c
index e68fb6ac34bf74735bb9738d8376f16cf66bebfb..4041e1864b0c6d659f92b334a78d0c1a5ca62133 100644 (file)
--- a/regex.c
+++ b/regex.c
@@ -2221,6 +2221,7 @@ regex_compile (pattern, size, syntax, bufp)
                         boolean is_lower = STREQ (str, "lower");
                         boolean is_upper = STREQ (str, "upper");
                        wctype_t wt;
+                       wchar_t twt;
                         int ch;
 
                        wt = wctype (str);
@@ -2235,7 +2236,7 @@ regex_compile (pattern, size, syntax, bufp)
 
                         for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
                          {
-                           if (iswctype (btowc (ch), wt))
+                           if (mbtowc (&twt, (char *)&ch, 1) >= 0 && iswctype (twt, wt))
                              SET_LIST_BIT (ch);
 
                            if (translate && (is_upper || is_lower)