]> granicus.if.org Git - mutt/commitdiff
Another charset fix from EGE.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 15 Aug 2000 13:22:32 +0000 (13:22 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 15 Aug 2000 13:22:32 +0000 (13:22 +0000)
mbyte.c
pager.c
protos.h

diff --git a/mbyte.c b/mbyte.c
index ba098a14a18509ce0f1c4b931db649a845226c5f..5f14606a697e106987510f83804d60e9427aca36 100644 (file)
--- 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 999290ae4f5fb2a14ddd1db23f5017371c032941..af3f3e653fba85141c41971e46cba687a229ec63 100644 (file)
--- 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;
index e3a4309e19174016f122228b72a5356c25b12db6..1d4b33ab8143a62e808c30c8ec36fc25fb93eb83 100644 (file)
--- 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))