]> diplodocus.org Git - nmh/blobdiff - uip/mhfixmsg.c
Fix to commit b828fcb1695393007a75c41d32b2173c296be9d7: a couple
[nmh] / uip / mhfixmsg.c
index 069e3284fe39cae7f1fc6f1968bebf3727100844..d1d796c1762412856c4dc623ac7b0029e8a828d2 100644 (file)
@@ -1163,12 +1163,9 @@ reformat_part (CT ct, char *file, char *type, char *subtype, int c_type) {
 /* Identifies 7bit or 8bit content based on charset. */
 static int
 charset_encoding (CT ct) {
-    /* norm_charmap() is case sensitive. */
-    char *charset = upcase (content_charset (ct));
     int encoding =
-        strcmp (norm_charmap (charset), "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
+        strcasecmp (content_charset (ct), "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
 
-    free (charset);
     return encoding;
 }
 
@@ -1594,8 +1591,7 @@ content_encoding (CT ct, const char **reason) {
 
 static int
 strip_crs (CT ct, int *message_mods) {
-    /* norm_charmap() is case sensitive. */
-    char *charset = upcase (content_charset (ct));
+    char *charset = content_charset (ct);
     int status = OK;
 
     /* Only strip carriage returns if content is ASCII or another
@@ -1603,10 +1599,10 @@ strip_crs (CT ct, int *message_mods) {
        LF.  We can include UTF-8 here because if the high-order bit of
        a UTF-8 byte is 0, then it must be a single-byte ASCII
        character. */
-    if (! strcmp (norm_charmap (charset), "US-ASCII")  ||
-        ! strncmp (norm_charmap (charset), "ISO-8859-", 9)  ||
-        ! strncmp (norm_charmap (charset), "UTF-8", 5)  ||
-        ! strncmp (norm_charmap (charset), "WINDOWS-12", 10)) {
+    if (! strcasecmp (charset, "US-ASCII")  ||
+        ! strcasecmp (charset, "UTF-8")  ||
+        ! strncasecmp (charset, "ISO-8859-", 9)  ||
+        ! strncasecmp (charset, "WINDOWS-12", 10)) {
         char **file = NULL;
         FILE **fp = NULL;
         size_t begin;
@@ -1730,7 +1726,6 @@ strip_crs (CT ct, int *message_mods) {
         }
     }
 
-    free (charset);
     return status;
 }