From: David Levine Date: Mon, 22 Dec 2014 01:41:12 +0000 (-0600) Subject: In expand_pseudoheader(), set Content-Type to 7-bit for ASCII text. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d47168b1771732a05e9538064da1cb788120ee41 In expand_pseudoheader(), set Content-Type to 7-bit for ASCII text. --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 9cc56351..7984b7d3 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -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); - 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). */ - 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); - 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). */ - (*text_plain_ct)->c_reqencoding = CE_8BIT; + (*text_plain_ct)->c_reqencoding = + strcasecmp (charset, "US-ASCII") ? CE_8BIT : CE_7BIT; } }