* 1) Instruct parser not to detect invalid Content-Transfer-Encoding
* 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.
*/
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;
/*
* Structures for TEXT messages
{ "alternative", MULTI_ALTERNATE },
{ "digest", MULTI_DIGEST },
{ "parallel", MULTI_PARALLEL },
+ { "related", MULTI_RELATED },
{ NULL, MULTI_UNKNOWN } /* this one must be last! */
};
if (!(p = get_content (fp, ct->c_file,
ct->c_subtype == MULTI_DIGEST ? -1 : 0))) {
free(bufp);
- fclose (ct->c_fp);
ct->c_fp = NULL;
return NOTOK;
}
fclose (ct->c_fp);
ct->c_fp = NULL;
}
+ free (bufp);
return fileno (ce->ce_fp);
clean_up:
fclose (ct->c_fp);
ct->c_fp = NULL;
}
+ free (bufp);
return NOTOK;
}
return "digest";
case MULTI_PARALLEL:
return "parallel";
+ case MULTI_RELATED:
+ return "related";
default:
return "unknown_multipart_subtype";
}
}
if (*cp == 0) {
- advise (NULL,
- "extraneous trailing ';' in message %s's %s: "
- "parameter list",
- filename, fieldname);
+ if (! suppress_extraneous_trailing_semicolon_warning) {
+ advise (NULL,
+ "extraneous trailing ';' in message %s's %s: "
+ "parameter list",
+ filename, fieldname);
+ }
+ extraneous_trailing_semicolon = 1;
return DONE;
}
"%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 &&
"param in message %s's %s: field\n%*s(parameter %s)",
filename, fieldname, strlen(invo_name) + 2, "",
nameptr);
+ free (nameptr);
return NOTOK;
}
}
}
/*
- * Return the charset for a particular content type. Return pointer is
- * only valid until the next call to content_charset().
+ * Return the charset for a particular content type.
*/
char *
content_charset (CT ct) {
- static char *ret_charset = NULL;
-
- if (ret_charset != NULL) {
- free(ret_charset);
- }
+ char *ret_charset = NULL;
ret_charset = get_param(ct->c_ctinfo.ci_first_pm, "charset", '?', 0);
- return ret_charset ? ret_charset : "US-ASCII";
+ return ret_charset ? ret_charset : getcpy ("US-ASCII");
}