]> diplodocus.org Git - nmh/commitdiff
In expand_pseudoheader(), set Content-Type to 7-bit for ASCII text.
authorDavid Levine <levinedl@acm.org>
Mon, 22 Dec 2014 01:41:12 +0000 (19:41 -0600)
committerDavid Levine <levinedl@acm.org>
Mon, 22 Dec 2014 01:41:12 +0000 (19:41 -0600)
uip/mhbuildsbr.c

index 9cc5635..7984b7d 100644 (file)
@@ -2283,10 +2283,10 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
     } else {
         set_charset (reply_ct, -1);
         charset = get_param (reply_ct->c_ctinfo.ci_first_pm, "charset", '?', 1);
     } else {
         set_charset (reply_ct, -1);
         charset = get_param (reply_ct->c_ctinfo.ci_first_pm, "charset", '?', 1);
-        if (reply_ct->c_reqencoding == CE_UNKNOWN  &&
-            strcasecmp (charset, "US-ASCII")) {
+        if (reply_ct->c_reqencoding == CE_UNKNOWN) {
             /* Assume that 8bit is sufficient (for text). */
             /* Assume that 8bit is sufficient (for text). */
-            reply_ct->c_reqencoding = CE_8BIT;
+            reply_ct->c_reqencoding =
+                strcasecmp (charset, "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
         }
     }
 
         }
     }
 
@@ -2299,10 +2299,10 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
             /* Make sure that the charset is set in the text/plain
                part. */
             set_charset (*text_plain_ct, -1);
             /* Make sure that the charset is set in the text/plain
                part. */
             set_charset (*text_plain_ct, -1);
-            if ((*text_plain_ct)->c_reqencoding == CE_UNKNOWN  &&
-                strcasecmp (charset, "US-ASCII")) {
+            if ((*text_plain_ct)->c_reqencoding == CE_UNKNOWN) {
                 /* Assume that 8bit is sufficient (for text). */
                 /* Assume that 8bit is sufficient (for text). */
-                (*text_plain_ct)->c_reqencoding = CE_8BIT;
+                (*text_plain_ct)->c_reqencoding =
+                    strcasecmp (charset, "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
             }
         }
 
             }
         }