]> diplodocus.org Git - nmh/commitdiff
More replacements of mh_strcasecmp() with strcasecmp().
authorDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 15:36:18 +0000 (10:36 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 15:36:18 +0000 (10:36 -0500)
uip/mhbuildsbr.c
uip/mhoutsbr.c
uip/mhstoresbr.c
uip/mshcmds.c

index 5d3679f66b7ee5f90eb04f9d0e52c184b3725924..1eaed6f008929452f118b1fc2923197b255f6c1f 100644 (file)
@@ -176,15 +176,15 @@ build_mime (char *infile, int directives)
            compnum++;
 
            /* abort if draft has Mime-Version header field */
            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 */
                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 */
                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);
                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++)
            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++;
                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:
         */
        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;
            }
                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++)
 
     /* 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;
 
     /*
            break;
 
     /*
@@ -608,10 +608,10 @@ call_init:
            /* NOTREACHED */
 
        case CT_MESSAGE:
            /* 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);
                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:
                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]
      */
      * 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;
        int msgnum;
        char *folder, *arguments[MAXARGS];
        struct msgs *mp;
@@ -824,7 +824,7 @@ use_forw:
     /*
      * #end
      */
     /*
      * #end
      */
-    if (!mh_strcasecmp (ci->ci_type, "end")) {
+    if (!strcasecmp (ci->ci_type, "end")) {
        free_content (ct);
        *ctp = NULL;
        return DONE;
        free_content (ct);
        *ctp = NULL;
        return DONE;
@@ -833,14 +833,14 @@ use_forw:
     /*
      * #begin [ alternative | parallel ]
      */
     /*
      * #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;
        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;
            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")) {
            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++) {
      * 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);
            continue;
 
        vp = add (";", vp);
@@ -1421,7 +1421,7 @@ build_headers (CT ct)
         * we have to break it across multiple lines
         */
 
         * 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=\"\"" */
            char *value = *ep;
 
            /* 7 here refers to " url=\"\"" */
index 4845f7e1a3cffcc43bf82dd11936b7c7e0a25b1f..3e5d3ce041198bd1fab1d954b9582657724dfd24 100644 (file)
@@ -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) {
     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;
         }
             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++)
 
            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;
                    }
                        fprintf (out, "%s", *ep);
                        break;
                    }
index 57604b5077ef47905eba9cf0a618a41af07b85ea..911dff691007dd712b4d96109c0731d5da77d05c 100644 (file)
@@ -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 */
 
        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;
                    break;
 
                tarP = 1;
@@ -228,14 +228,14 @@ store_application (CT ct)
            }
 
            /* check for "conversions=compress" attribute */
            }
 
            /* 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 */
                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;
            }
                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)
         * 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 */
     }
            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) {
 
 int
 save_clobber_policy (const char *value) {
-  if (! mh_strcasecmp (value, "always")) {
+  if (! strcasecmp (value, "always")) {
     clobber_policy = NMH_CLOBBER_ALWAYS;
     clobber_policy = NMH_CLOBBER_ALWAYS;
-  } else if (! mh_strcasecmp (value, "auto")) {
+  } else if (! strcasecmp (value, "auto")) {
     clobber_policy = NMH_CLOBBER_AUTO;
     clobber_policy = NMH_CLOBBER_AUTO;
-  } else if (! mh_strcasecmp (value, "suffix")) {
+  } else if (! strcasecmp (value, "suffix")) {
     clobber_policy = NMH_CLOBBER_SUFFIX;
     clobber_policy = NMH_CLOBBER_SUFFIX;
-  } else if (! mh_strcasecmp (value, "ask")) {
+  } else if (! strcasecmp (value, "ask")) {
     clobber_policy = NMH_CLOBBER_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;
     clobber_policy = NMH_CLOBBER_NEVER;
   } else {
     return 1;
index 41017430e837189323d4b54e60494b1aaafd9ea3..a6847d51b03d6ce2930ce1c0fc94f8e6b4177b43 100644 (file)
@@ -2105,10 +2105,10 @@ showcmd (char **args)
     char *cp, *proc = showproc, buf[BUFSIZ];
     char *msgs[MAXARGS], *vec[MAXARGS];
 
     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
        mode = 1;
     else
-       if (!mh_strcasecmp (cmd_name, "prev"))
+       if (!strcasecmp (cmd_name, "prev"))
            mode = -1;
     while ((cp = *args++)) {
        if (*cp == '-')
            mode = -1;
     while ((cp = *args++)) {
        if (*cp == '-')
@@ -2350,7 +2350,7 @@ is_nontext (int msgnum)
            /*
             * Check Content-Type field
             */
            /*
             * Check Content-Type field
             */
-           if (!mh_strcasecmp (name, TYPE_FIELD)) {
+           if (!strcasecmp (name, TYPE_FIELD)) {
                int passno;
                char c;
 
                int passno;
                char c;
 
@@ -2406,7 +2406,7 @@ invalid:
                if (!*bp)
                    goto invalid;
                if (passno > 1) {
                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++)
                        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 {
                    /* 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;
                        *dp = c;
                        bp = dp;
                        passno = 2;
@@ -2457,7 +2457,7 @@ out:
            /*
             * Check Content-Transfer-Encoding field
             */
            /*
             * 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;
                cp = add (buf, NULL);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
@@ -2469,9 +2469,9 @@ out:
                for (dp = bp; istoken (*dp); dp++)
                    continue;
                *dp = '\0';
                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) {
 
                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: 
        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;
                    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++;
                }
                        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;
                    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 (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:"))
            while ((c = *cp)) {
                if (! isspace(c)) {
                    if(uprf(cp, "re:"))