X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6b4bc4a25eaac2eddd1bef51e3f00c21f98ed32d..abbd6450510ebf4a68c726b5a455dfcfb6fe2aa6:/uip/mhbuildsbr.c diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 459a2559..8d3a76df 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #include #include @@ -176,15 +174,15 @@ build_mime (char *infile, int directives) compnum++; /* abort if draft has Mime-Version header field */ - if (!mh_strcasecmp (name, VRSN_FIELD)) + if (!strcasecmp (name, VRSN_FIELD)) adios (NULL, "draft shouldn't contain %s: field", VRSN_FIELD); /* abort if draft has Content-Transfer-Encoding header field */ - if (!mh_strcasecmp (name, ENCODING_FIELD)) + if (!strcasecmp (name, ENCODING_FIELD)) adios (NULL, "draft shouldn't contain %s: field", ENCODING_FIELD); /* ignore any Content-Type fields in the header */ - if (!mh_strcasecmp (name, TYPE_FIELD)) { + if (!strcasecmp (name, TYPE_FIELD)) { while (state == FLDPLUS) { bufsz = sizeof buf; state = m_getfld (&gstate, name, buf, &bufsz, in); @@ -347,12 +345,6 @@ finish_field: static int init_decoded_content (CT ct) { - CE ce; - - if ((ce = (CE) calloc (1, sizeof(*ce))) == NULL) - adios (NULL, "out of memory"); - - ct->c_cefile = ce; ct->c_ceopenfnx = open7Bit; /* since unencoded */ ct->c_ceclosefnx = close_encoding; ct->c_cesizefnx = NULL; /* since unencoded */ @@ -430,7 +422,7 @@ user_content (FILE *in, char *file, char *buf, CT *ctp) /* allocate basic structure for handling decoded content */ init_decoded_content (ct); - ce = ct->c_cefile; + ce = &ct->c_cefile; ci = &ct->c_ctinfo; set_id (ct, 0); @@ -547,7 +539,7 @@ rock_and_roll: done (1); for (s2i = str2cts; s2i->si_key; s2i++) - if (!mh_strcasecmp (ci->ci_type, s2i->si_key)) + if (!strcasecmp (ci->ci_type, s2i->si_key)) break; if (!s2i->si_key && !uprf (ci->ci_type, "X-")) s2i++; @@ -557,7 +549,7 @@ rock_and_roll: */ switch (ct->c_type = s2i->si_val) { case CT_MESSAGE: - if (!mh_strcasecmp (ci->ci_subtype, "rfc822")) { + if (!strcasecmp (ci->ci_subtype, "rfc822")) { ct->c_encoding = CE_7BIT; goto call_init; } @@ -593,7 +585,7 @@ call_init: /* check directive against the list of MIME types */ for (s2i = str2cts; s2i->si_key; s2i++) - if (!mh_strcasecmp (ci->ci_type, s2i->si_key)) + if (!strcasecmp (ci->ci_type, s2i->si_key)) break; /* @@ -614,10 +606,10 @@ call_init: /* NOTREACHED */ case CT_MESSAGE: - if (!mh_strcasecmp (ci->ci_subtype, "partial")) + if (!strcasecmp (ci->ci_subtype, "partial")) adios (NULL, "sorry, \"#%s/%s\" isn't supported", ci->ci_type, ci->ci_subtype); - if (!mh_strcasecmp (ci->ci_subtype, "external-body")) + if (!strcasecmp (ci->ci_subtype, "external-body")) adios (NULL, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); use_forw: @@ -724,7 +716,7 @@ use_forw: * Message directive * #forw [+folder] [msgs] */ - if (!mh_strcasecmp (ci->ci_type, "forw")) { + if (!strcasecmp (ci->ci_type, "forw")) { int msgnum; char *folder, *arguments[MAXARGS]; struct msgs *mp; @@ -791,7 +783,7 @@ use_forw: if ((p = (CT) calloc (1, sizeof(*p))) == NULL) adios (NULL, "out of memory"); init_decoded_content (p); - pe = p->c_cefile; + pe = &p->c_cefile; if (get_ctinfo ("message/rfc822", p, 0) == NOTOK) done (1); p->c_type = CT_MESSAGE; @@ -830,7 +822,7 @@ use_forw: /* * #end */ - if (!mh_strcasecmp (ci->ci_type, "end")) { + if (!strcasecmp (ci->ci_type, "end")) { free_content (ct); *ctp = NULL; return DONE; @@ -839,14 +831,14 @@ use_forw: /* * #begin [ alternative | parallel ] */ - if (!mh_strcasecmp (ci->ci_type, "begin")) { + if (!strcasecmp (ci->ci_type, "begin")) { if (!ci->ci_magic) { vrsn = MULTI_MIXED; cp = SubMultiPart[vrsn - 1].kv_key; - } else if (!mh_strcasecmp (ci->ci_magic, "alternative")) { + } else if (!strcasecmp (ci->ci_magic, "alternative")) { vrsn = MULTI_ALTERNATE; cp = SubMultiPart[vrsn - 1].kv_key; - } else if (!mh_strcasecmp (ci->ci_magic, "parallel")) { + } else if (!strcasecmp (ci->ci_magic, "parallel")) { vrsn = MULTI_PARALLEL; cp = SubMultiPart[vrsn - 1].kv_key; } else if (uprf (ci->ci_magic, "digest")) { @@ -926,7 +918,7 @@ set_id (CT ct, int top) static int compose_content (CT ct) { - CE ce = ct->c_cefile; + CE ce = &ct->c_cefile; switch (ct->c_type) { case CT_MULTIPART: @@ -1163,7 +1155,7 @@ scan_content (CT ct) char *cp = NULL, buffer[BUFSIZ]; struct text *t = NULL; FILE *in = NULL; - CE ce = ct->c_cefile; + CE ce = &ct->c_cefile; /* * handle multipart by scanning all subparts @@ -1416,7 +1408,7 @@ build_headers (CT ct) * the end of the Content-Type line. */ for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { - if (mailbody && !mh_strcasecmp (*ap, "body")) + if (mailbody && !strcasecmp (*ap, "body")) continue; vp = add (";", vp); @@ -1427,7 +1419,7 @@ build_headers (CT ct) * we have to break it across multiple lines */ - if (extbody && mh_strcasecmp (*ap, "url") == 0) { + if (extbody && strcasecmp (*ap, "url") == 0) { char *value = *ep; /* 7 here refers to " url=\"\"" */ @@ -1632,7 +1624,7 @@ calculate_digest (CT ct, int asciiP) unsigned char digest[16]; unsigned char outbuf[25]; MD5_CTX mdContext; - CE ce = ct->c_cefile; + CE ce = &ct->c_cefile; char *infilename = ce->ce_file ? ce->ce_file : ct->c_file; FILE *in;