]> granicus.if.org Git - mutt/commitdiff
Fix bug#22.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Feb 2000 14:17:01 +0000 (14:17 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Feb 2000 14:17:01 +0000 (14:17 +0000)
muttlib.c
protos.h
rfc2047.c
rfc2231.c

index 5dc82bad65c534e53be8f70366cc0826b643fe75..2bc5b132094b9ee64317db1a00165c8e97eb2c5c 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1025,3 +1025,13 @@ int state_printf(STATE *s, const char *fmt, ...)
   
   return rv;
 }
+
+void mutt_display_sanitize (char *s)
+{
+  for (; *s; s++)
+  {
+    if (!IsPrint (*s))
+      *s = '?';
+  }
+}
+      
index cc6727469e469b0b9af157f791c787c9b0503184..94519d71fe714952c58eedc6bf888d1784ad27b3 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -138,6 +138,7 @@ void mutt_create_alias (ENVELOPE *, ADDRESS *);
 void mutt_decode_attachment (BODY *, STATE *);
 void mutt_default_save (char *, size_t, HEADER *);
 void mutt_display_address (ENVELOPE *);
+void mutt_display_sanitize (char *);
 void mutt_edit_content_type (HEADER *, BODY *);
 void mutt_edit_file (const char *, const char *);
 void mutt_edit_headers (const char *, const char *, HEADER *, char *, size_t);
index 89cd09ae0ac7f08d47cc8f972d89aa27948f1863..c3ea04575b590097ebd4128abf3fe446748454c6 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -290,11 +290,8 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len)
        /* ignore language specification a la RFC 2231 */        
         if ((t = strchr (pp, '*')))
          *t = '\0';
-       if (mutt_strcasecmp (pp, Charset) != 0)
-        {
-         filter = 1;
-         charset = pp;
-       }
+        charset = pp;
+        filter = 1;
        break;
       case 3:
        if (toupper (*pp) == 'Q')
@@ -373,14 +370,10 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len)
       CHARSET *chs = mutt_get_charset(Charset);
       mutt_decode_utf8_string(d, chs);
     }
-    else if (mutt_display_string(d, mutt_get_translation(charset, Charset)) == -1)
-    {
-      for(pd = d; *pd; pd++)
-      {
-        if (!IsPrint (*pd))
-         *pd = '?';
-      }
-    }
+    else
+      mutt_display_string(d, mutt_get_translation(charset, Charset));
+
+    mutt_display_sanitize (d);
   }
   safe_free ((void **) &p);
   return (0);
index 248f50f0986f1cb59e3616cf416e93734926f804..209042c045c929429d3b4a494d8a31f42765000c 100644 (file)
--- a/rfc2231.c
+++ b/rfc2231.c
@@ -224,6 +224,8 @@ static void rfc2231_decode_one (char *dest, char *src, char *chs)
       mutt_decode_utf8_string (dest, mutt_get_charset (Charset));
     else
       mutt_display_string (dest, mutt_get_translation (chs, Charset));
+    
+    mutt_display_sanitize (dest);
   }
 }