From: David Levine Date: Sun, 24 Mar 2013 15:36:18 +0000 (-0500) Subject: More replacements of mh_strcasecmp() with strcasecmp(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/0c01170320f36b1c900ce63d6f40c5458521ba27?ds=inline;hp=b236a6a2a2ff899564b9a88cfc377c3de145e37e More replacements of mh_strcasecmp() with strcasecmp(). --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 5d3679f6..1eaed6f0 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -176,15 +176,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); @@ -541,7 +541,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++; @@ -551,7 +551,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; } @@ -587,7 +587,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; /* @@ -608,10 +608,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: @@ -718,7 +718,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; @@ -824,7 +824,7 @@ use_forw: /* * #end */ - if (!mh_strcasecmp (ci->ci_type, "end")) { + if (!strcasecmp (ci->ci_type, "end")) { free_content (ct); *ctp = NULL; return DONE; @@ -833,14 +833,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")) { @@ -1410,7 +1410,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); @@ -1421,7 +1421,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=\"\"" */ diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 4845f7e1..3e5d3ce0 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -86,7 +86,7 @@ output_content (CT ct, FILE *out) char *boundary = ci->ci_values[0], **ap, **vp; for (ap = ci->ci_attrs, vp = ci->ci_values; *ap; ++ap, ++vp) { - if (! mh_strcasecmp ("boundary", *ap)) { + if (! strcasecmp ("boundary", *ap)) { boundary = *vp; break; } @@ -249,7 +249,7 @@ writeExternalBody (CT ct, FILE *out) case 'N': for (ap = ci2->ci_attrs, ep = ci2->ci_values; *ap; ap++, ep++) - if (!mh_strcasecmp (*ap, "name")) { + if (!strcasecmp (*ap, "name")) { fprintf (out, "%s", *ep); break; } diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 57604b50..911dff69 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -219,8 +219,8 @@ store_application (CT ct) for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) { /* check for "type=tar" attribute */ - if (!mh_strcasecmp (*ap, "type")) { - if (mh_strcasecmp (*ep, "tar")) + if (!strcasecmp (*ap, "type")) { + if (strcasecmp (*ep, "tar")) break; tarP = 1; @@ -228,14 +228,14 @@ store_application (CT ct) } /* check for "conversions=compress" attribute */ - if ((!mh_strcasecmp (*ap, "conversions") || !mh_strcasecmp (*ap, "x-conversions")) - && (!mh_strcasecmp (*ep, "compress") || !mh_strcasecmp (*ep, "x-compress"))) { + if ((!strcasecmp (*ap, "conversions") || !strcasecmp (*ap, "x-conversions")) + && (!strcasecmp (*ep, "compress") || !strcasecmp (*ep, "x-compress"))) { zP = 1; continue; } /* check for "conversions=gzip" attribute */ - if ((!mh_strcasecmp (*ap, "conversions") || !mh_strcasecmp (*ap, "x-conversions")) - && (!mh_strcasecmp (*ep, "gzip") || !mh_strcasecmp (*ep, "x-gzip"))) { + if ((!strcasecmp (*ap, "conversions") || !strcasecmp (*ap, "x-conversions")) + && (!strcasecmp (*ep, "gzip") || !strcasecmp (*ep, "x-gzip"))) { gzP = 1; continue; } @@ -1099,10 +1099,10 @@ copy_some_headers (FILE *out, CT ct) * messages are not copied. */ if (!uprf (hp->name, XXX_FIELD_PRF) - && mh_strcasecmp (hp->name, VRSN_FIELD) - && mh_strcasecmp (hp->name, "Subject") - && mh_strcasecmp (hp->name, "Encrypted") - && mh_strcasecmp (hp->name, "Message-ID")) + && strcasecmp (hp->name, VRSN_FIELD) + && strcasecmp (hp->name, "Subject") + && strcasecmp (hp->name, "Encrypted") + && strcasecmp (hp->name, "Message-ID")) fprintf (out, "%s:%s", hp->name, hp->value); hp = hp->next; /* next header field */ } @@ -1127,15 +1127,15 @@ int files_not_clobbered = 0; int save_clobber_policy (const char *value) { - if (! mh_strcasecmp (value, "always")) { + if (! strcasecmp (value, "always")) { clobber_policy = NMH_CLOBBER_ALWAYS; - } else if (! mh_strcasecmp (value, "auto")) { + } else if (! strcasecmp (value, "auto")) { clobber_policy = NMH_CLOBBER_AUTO; - } else if (! mh_strcasecmp (value, "suffix")) { + } else if (! strcasecmp (value, "suffix")) { clobber_policy = NMH_CLOBBER_SUFFIX; - } else if (! mh_strcasecmp (value, "ask")) { + } else if (! strcasecmp (value, "ask")) { clobber_policy = NMH_CLOBBER_ASK; - } else if (! mh_strcasecmp (value, "never")) { + } else if (! strcasecmp (value, "never")) { clobber_policy = NMH_CLOBBER_NEVER; } else { return 1; diff --git a/uip/mshcmds.c b/uip/mshcmds.c index 41017430..a6847d51 100644 --- a/uip/mshcmds.c +++ b/uip/mshcmds.c @@ -2105,10 +2105,10 @@ showcmd (char **args) char *cp, *proc = showproc, buf[BUFSIZ]; char *msgs[MAXARGS], *vec[MAXARGS]; - if (!mh_strcasecmp (cmd_name, "next")) + if (!strcasecmp (cmd_name, "next")) mode = 1; else - if (!mh_strcasecmp (cmd_name, "prev")) + if (!strcasecmp (cmd_name, "prev")) mode = -1; while ((cp = *args++)) { if (*cp == '-') @@ -2350,7 +2350,7 @@ is_nontext (int msgnum) /* * Check Content-Type field */ - if (!mh_strcasecmp (name, TYPE_FIELD)) { + if (!strcasecmp (name, TYPE_FIELD)) { int passno; char c; @@ -2406,7 +2406,7 @@ invalid: if (!*bp) goto invalid; if (passno > 1) { - if ((result = (mh_strcasecmp (bp, "plain") != 0))) + if ((result = (strcasecmp (bp, "plain") != 0))) goto out; *dp = c; for (dp++; isspace ((unsigned char) *dp); dp++) @@ -2438,7 +2438,7 @@ invalid: /* Check the character set */ result = !check_charset (dp, strlen (dp)); } else { - if (!(result = (mh_strcasecmp (bp, "text") != 0))) { + if (!(result = (strcasecmp (bp, "text") != 0))) { *dp = c; bp = dp; passno = 2; @@ -2457,7 +2457,7 @@ out: /* * Check Content-Transfer-Encoding field */ - if (!mh_strcasecmp (name, ENCODING_FIELD)) { + if (!strcasecmp (name, ENCODING_FIELD)) { cp = add (buf, NULL); while (state == FLDPLUS) { bufsz = sizeof buf; @@ -2469,9 +2469,9 @@ out: for (dp = bp; istoken (*dp); dp++) continue; *dp = '\0'; - result = (mh_strcasecmp (bp, "7bit") - && mh_strcasecmp (bp, "8bit") - && mh_strcasecmp (bp, "binary")); + result = (strcasecmp (bp, "7bit") + && strcasecmp (bp, "8bit") + && strcasecmp (bp, "binary")); free (cp); if (result) { @@ -2657,7 +2657,7 @@ get_fields (char *datesw, char *subjsw, int msgnum, struct Msg *msgp) switch (state = m_getfld (&gstate, name, buf, &bufsz, zp)) { case FLD: case FLDPLUS: - if (!mh_strcasecmp (name, datesw)) { + if (!strcasecmp (name, datesw)) { bp = getcpy (buf); while (state == FLDPLUS) { bufsz = sizeof buf; @@ -2675,7 +2675,7 @@ get_fields (char *datesw, char *subjsw, int msgnum, struct Msg *msgp) break; /* all done! */ gotdate++; } - else if (subjsw && !mh_strcasecmp(name, subjsw)) { + else if (subjsw && !strcasecmp(name, subjsw)) { bp = getcpy (buf); while (state == FLDPLUS) { bufsz = sizeof buf; @@ -2758,7 +2758,7 @@ sosmash (char *subj, char *s) if (s) { cp = s; dp = s; /* dst pointer */ - if (!mh_strcasecmp (subj, "subject")) + if (!strcasecmp (subj, "subject")) while ((c = *cp)) { if (! isspace(c)) { if(uprf(cp, "re:"))