From: Fabian Groffen Date: Thu, 22 Jul 2010 18:06:33 +0000 (+0200) Subject: http://thread.gmane.org/gmane.mail.mutt.devel/15710 X-Git-Tag: mutt-1-5-22-rel~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db5b3a8a455218d3f76bb37e18108c690f81793e;p=mutt http://thread.gmane.org/gmane.mail.mutt.devel/15710 Interix doesn't have btowc, but it does have mbtowc. Linux manpage also discourages the use of btowc. --- diff --git a/regex.c b/regex.c index e68fb6ac..4041e186 100644 --- 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)