]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
configure.ac: Add FIXME regarding _BSD_SOURCE for tm.tm_gmtoff test.
[nmh] / uip / mhparse.c
index beaa294a23cb36ecebec4cdd21f11865164442bb..d729768abd04fa265dffe58cc6801261d419f233 100644 (file)
@@ -34,13 +34,16 @@ int checksw = 0;    /* check Content-MD5 field */
  *    in a multipart.
  * 2) Suppress the warning about bogus multipart content, and report it.
  * 3) Suppress the warning about extraneous trailing ';' in header parameter
- *    lists, and report it.
+ *    lists.
  */
 int skip_mp_cte_check;
 int suppress_bogus_mp_content_warning;
 int bogus_mp_content;
 int suppress_extraneous_trailing_semicolon_warning;
-int extraneous_trailing_semicolon;
+
+/*
+ * By default, suppress warning about multiple MIME-Version header fields.
+ */
 int suppress_multiple_mime_version_warning = 1;
 
 /* list of preferred type/subtype pairs, for -prefer */
@@ -207,6 +210,8 @@ parse_mime (char *file)
     CT ct;
     size_t n;
 
+    bogus_mp_content = 0;
+
     /*
      * Check if file is actually standard input
      */
@@ -657,10 +662,7 @@ get_ctinfo (char *cp, CT ct, int magic)
                TYPE_FIELD, ct->c_file);
        return NOTOK;
     }
-
-    /* down case the content type string */
-    for (dp = ci->ci_type; *dp; dp++)
-        *dp = tolower ((unsigned char) *dp);
+    ToLower(ci->ci_type);
 
     while (isspace ((unsigned char) *cp))
        cp++;
@@ -695,10 +697,7 @@ get_ctinfo (char *cp, CT ct, int magic)
                TYPE_FIELD, ct->c_file, ci->ci_type);
        return NOTOK;
     }
-
-    /* down case the content subtype string */
-    for (dp = ci->ci_subtype; *dp; dp++)
-        *dp = tolower ((unsigned char) *dp);
+    ToLower(ci->ci_subtype);
 
 magic_skip:
     while (isspace ((unsigned char) *cp))
@@ -3288,7 +3287,6 @@ parse_header_attrs (const char *filename, const char *fieldname,
                        "parameter list",
                        filename, fieldname);
            }
-           extraneous_trailing_semicolon = 1;
            return DONE;
        }
 
@@ -3525,8 +3523,11 @@ bad_quote:
 
        if (partial) {
            for (pp = phead; pp != NULL; pp = pp->next) {
-               if (strcasecmp(nameptr, pp->name) == 0)
+               if (strcasecmp(nameptr, pp->name) == 0) {
+                    free (nameptr);
+                    nameptr = pp->name;
                    break;
+                }
            }
 
            if (pp == NULL) {
@@ -3555,7 +3556,6 @@ bad_quote:
                                "%s's %s: field\n%*s(parameter %s)", sp->index,
                                filename, fieldname, strlen(invo_name) + 2, "",
                                nameptr);
-                       free (nameptr);
                        return NOTOK;
                    }
                    if (sp2->index < sp->index &&
@@ -3571,7 +3571,6 @@ bad_quote:
                           "param in message %s's %s: field\n%*s(parameter %s)",
                           filename, fieldname, strlen(invo_name) + 2, "",
                           nameptr);
-                   free (nameptr);
                    return NOTOK;
                }
            }