X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=1c46076d3d478aedd0f43f60034c125f9b6871ab;hp=86a08b7a7976ef038cca88f4e972909bf276dc76;hb=c085eca6dea41bf9c0ac2749215e256cc54ff628;hpb=ba32dee02e85132dd8bd05fae876692d61c50053 diff --git a/uip/mhparse.c b/uip/mhparse.c index 86a08b7..1c46076 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1568,6 +1568,8 @@ openBase64 (CT ct, char **file) unsigned long bits; unsigned char value, *b, *b1, *b2, *b3; char *cp, *ep, buffer[BUFSIZ]; + /* sbeck -- handle prefixes */ + CI ci; CE ce; MD5_CTX mdContext; @@ -1598,6 +1600,19 @@ openBase64 (CT ct, char **file) ce->ce_unlink = 0; } + /* sbeck@cise.ufl.edu -- handle suffixes */ + ci = &ct->c_ctinfo; + snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", + invo_name, ci->ci_type, ci->ci_subtype); + cp = context_find (buffer); + if (cp == NULL || *cp == '\0') { + snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, + ci->ci_type); + cp = context_find (buffer); + } + if (cp != NULL && *cp != '\0') + ce->ce_file = add (cp, ce->ce_file); + if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; @@ -1767,6 +1782,8 @@ openQuoted (CT ct, char **file) char buffer[BUFSIZ]; unsigned char mask; CE ce; + /* sbeck -- handle prefixes */ + CI ci; MD5_CTX mdContext; ce = ct->c_cefile; @@ -1791,6 +1808,24 @@ openQuoted (CT ct, char **file) ce->ce_unlink = 0; } + /* sbeck@cise.ufl.edu -- handle suffixes */ + ci = &ct->c_ctinfo; + snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", + invo_name, ci->ci_type, ci->ci_subtype); + cp = context_find (buffer); + if (cp == NULL || *cp == '\0') { + snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, + ci->ci_type); + cp = context_find (buffer); + } + if (cp != NULL && *cp != '\0') + ce->ce_file = add (cp, ce->ce_file); + + if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { + content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); + return NOTOK; + } + if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK; @@ -1965,6 +2000,9 @@ open7Bit (CT ct, char **file) { int cc, fd, len; char buffer[BUFSIZ]; + /* sbeck -- handle prefixes */ + char *cp; + CI ci; CE ce; ce = ct->c_cefile; @@ -1989,6 +2027,19 @@ open7Bit (CT ct, char **file) ce->ce_unlink = 0; } + /* sbeck@cise.ufl.edu -- handle suffixes */ + ci = &ct->c_ctinfo; + snprintf (buffer, sizeof(buffer), "%s-suffix-%s/%s", + invo_name, ci->ci_type, ci->ci_subtype); + cp = context_find (buffer); + if (cp == NULL || *cp == '\0') { + snprintf (buffer, sizeof(buffer), "%s-suffix-%s", invo_name, + ci->ci_type); + cp = context_find (buffer); + } + if (cp != NULL && *cp != '\0') + ce->ce_file = add (cp, ce->ce_file); + if ((ce->ce_fp = fopen (ce->ce_file, "w+")) == NULL) { content_error (ce->ce_file, ct, "unable to fopen for reading/writing"); return NOTOK;