From: Thomas Roessler Date: Tue, 15 Aug 2000 13:22:32 +0000 (+0000) Subject: Another charset fix from EGE. X-Git-Tag: mutt-1-3-8-rel~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c1bdb4e599f371f504b4c1483a380375a2fb8636;p=mutt Another charset fix from EGE. --- diff --git a/mbyte.c b/mbyte.c index ba098a14..5f14606a 100644 --- a/mbyte.c +++ b/mbyte.c @@ -81,7 +81,7 @@ int iswprint (wint_t wc) if (Charset_is_utf8) return ((0x20 <= wc && wc < 0x7f) || 0xa0 <= wc); else - return (0 <= wc && wc < 256) ? IsPrint(wc) : 0; + return (0 <= wc && wc < 256) ? isprint (wc) : 0; } #endif /* !HAVE_WC_FUNCS */ diff --git a/pager.c b/pager.c index 999290ae..af3f3e65 100644 --- a/pager.c +++ b/pager.c @@ -1008,7 +1008,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, /* Handle backspace */ special = 0; - if (iswprint (wc)) + if (IsWPrint (wc)) { wchar_t wc1; mbstate_t mbstate1; @@ -1019,7 +1019,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, wc1 == '\b') && (wc1 = 0, k2 = mbrtowc (&wc1, (char *)buf+ch+k1, cnt-ch-k1, &mbstate1), - iswprint (wc1))) + IsWPrint (wc1))) { if (wc == wc1) { @@ -1047,7 +1047,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, || pa->attr)) resolve_color (*lineInfo, n, vch, flags, special, pa); - if (iswprint (wc)) + if (IsWPrint (wc)) { if (wc == ' ') space = ch; diff --git a/protos.h b/protos.h index e3a4309e..1d4b33ab 100644 --- a/protos.h +++ b/protos.h @@ -325,10 +325,13 @@ int mutt_utf8towc (unsigned int *pwc, const char *s, size_t n); #ifdef LOCALES_HACK #define IsPrint(c) (isprint((unsigned char)(c)) || \ ((unsigned char)(c) >= 0xa0)) +#define IsWPrint(wc) (iswprint(wc) || wc >= 0xa0) #else #define IsPrint(c) (isprint((unsigned char)(c)) || \ (option (OPTLOCALES) ? 0 : \ ((unsigned char)(c) >= 0xa0))) +#define IsWPrint(wc) (iswprint(wc) || \ + (option (OPTLOCALES) ? 0 : (wc >= 0xa0))) #endif #define new_pattern() safe_calloc(1, sizeof (pattern_t))