]> diplodocus.org Git - nmh/commitdiff
More replacements of mh_strcasecmp() with strcasecmp().
authorDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 16:45:42 +0000 (11:45 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 16:45:42 +0000 (11:45 -0500)
uip/ali.c
uip/fmttest.c
uip/mhmisc.c
uip/mhparam.c
uip/msh.c
uip/picksbr.c
uip/post.c
uip/replsbr.c
uip/sortm.c

index 3893a1d8ad16c1455cb6abee3bd1dab18d4d3ac4..1fa7ef848bca3166fec90df8ce98b3904cc94c2b 100644 (file)
--- a/uip/ali.c
+++ b/uip/ali.c
@@ -231,8 +231,10 @@ print_usr (char *s, int list, int norm)
        while ((cp = getname (pp))) {
            if ((np = getm (cp, NULL, 0, norm, NULL)) == NULL)
                continue;
        while ((cp = getname (pp))) {
            if ((np = getm (cp, NULL, 0, norm, NULL)) == NULL)
                continue;
-           if (!mh_strcasecmp (mp->m_host, np->m_host)
-                   && !mh_strcasecmp (mp->m_mbox, np->m_mbox)) {
+           if (!strcasecmp (mp->m_host ? mp->m_host : "",
+                            np->m_host ? np->m_host : "")  &&
+               !strcasecmp (mp->m_mbox ? mp->m_mbox : "",
+                            np->m_mbox ? np->m_mbox : "")) {
                vp = vp ? add (ak->ak_name, add (",", vp))
                    : getcpy (ak->ak_name);
                mnfree (np);
                vp = vp ? add (ak->ak_name, add (",", vp))
                    : getcpy (ak->ak_name);
                mnfree (np);
index 8b81924b8ca22e176e2b433aaec512b4589ea8a1..cbc3459ab6e8991771c5de254365d46e35043363 100644 (file)
@@ -1301,8 +1301,10 @@ insert (struct mailname *np)
        return 0;
 
     for (mp = &mq; mp->m_next; mp = mp->m_next) {
        return 0;
 
     for (mp = &mq; mp->m_next; mp = mp->m_next) {
-       if (!mh_strcasecmp (np->m_host, mp->m_next->m_host)
-               && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox))
+       if (!strcasecmp (np->m_host ? np->m_host : "",
+                        mp->m_next->m_host ? mp->m_next->m_host : "") &&
+           !strcasecmp (np->m_mbox ? np->m_mbox : "",
+                        mp->m_next->m_mbox ? mp->m_next->m_mbox : ""))
            return 0;
     }
     if (!ccme && ismymbox (np))
            return 0;
     }
     if (!ccme && ismymbox (np))
index 86b8ad804f52212f070e261bf123d14ba6183246..895ec313f9d9ef1de411b6eaaf253c3dacbab06f 100644 (file)
@@ -69,7 +69,7 @@ type_ok (CT ct, int sP)
 
     snprintf (buffer, sizeof(buffer), "%s/%s", ci->ci_type, ci->ci_subtype);
     for (ap = types; *ap; ap++)
 
     snprintf (buffer, sizeof(buffer), "%s/%s", ci->ci_type, ci->ci_subtype);
     for (ap = types; *ap; ap++)
-       if (!mh_strcasecmp (*ap, ci->ci_type) || !mh_strcasecmp (*ap, buffer))
+       if (!strcasecmp (*ap, ci->ci_type) || !strcasecmp (*ap, buffer))
            return 1;
 
     return 0;
            return 1;
 
     return 0;
index 414255bab30208044639586c9e873da1c208969e..a1ca28f75d3d597ffa8a458fe9dfa9fbc015c34b 100644 (file)
@@ -201,7 +201,7 @@ p_find(char *str)
     struct proc *ps;
 
     for (ps = procs; ps->p_name; ps++)
     struct proc *ps;
 
     for (ps = procs; ps->p_name; ps++)
-       if (!mh_strcasecmp (ps->p_name, str))
+       if (!strcasecmp (ps->p_name, str ? str : ""))
            return (*ps->p_field);
 
     return NULL;
            return (*ps->p_field);
 
     return NULL;
index c1f0fc3aeac053faaae61b14a67c2b2604f55118..cdec7664827dcc7ee45ab05e89960b8b4a8c666f 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -983,7 +983,7 @@ readid (int msgnum)
        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, BBoard_ID)) {
+               if (!strcasecmp (name, BBoard_ID)) {
                    bp = getcpy (buf);
                    while (state == FLDPLUS) {
                        bufsz = sizeof buf;
                    bp = getcpy (buf);
                    while (state == FLDPLUS) {
                        bufsz = sizeof buf;
index ec7400a36e1ffaf2479ec158e9a54a59ff03e78d..6035470341e86573124c5113c6bdef3a84a51f68 100644 (file)
@@ -895,19 +895,19 @@ tws_special (char *ap)
     register struct tws *tw;
 
     time (&clock);
     register struct tws *tw;
 
     time (&clock);
-    if (!mh_strcasecmp (ap, "today"))
+    if (!strcasecmp (ap, "today"))
        return dlocaltime (&clock);
        return dlocaltime (&clock);
-    if (!mh_strcasecmp (ap, "yesterday")) {
+    if (!strcasecmp (ap, "yesterday")) {
        clock -= (long) (60 * 60 * 24);
        return dlocaltime (&clock);
     }
        clock -= (long) (60 * 60 * 24);
        return dlocaltime (&clock);
     }
-    if (!mh_strcasecmp (ap, "tomorrow")) {
+    if (!strcasecmp (ap, "tomorrow")) {
        clock += (long) (60 * 60 * 24);
        return dlocaltime (&clock);
     }
 
     for (i = 0; tw_ldotw[i]; i++)
        clock += (long) (60 * 60 * 24);
        return dlocaltime (&clock);
     }
 
     for (i = 0; tw_ldotw[i]; i++)
-       if (!mh_strcasecmp (ap, tw_ldotw[i]))
+       if (!strcasecmp (ap, tw_ldotw[i]))
            break;
     if (tw_ldotw[i]) {
        if ((tw = dlocaltime (&clock)) == NULL)
            break;
     if (tw_ldotw[i]) {
        if ((tw = dlocaltime (&clock)) == NULL)
@@ -951,7 +951,7 @@ plist
                    state = m_getfld (&gstate, name, buf, &bufsz, fp);
                    bp = add (buf, bp);
                }
                    state = m_getfld (&gstate, name, buf, &bufsz, fp);
                    bp = add (buf, bp);
                }
-               if (!mh_strcasecmp (name, n->n_datef))
+               if (!strcasecmp (name, n->n_datef))
                    break;
                continue;
 
                    break;
                continue;
 
index 9b8bcbeff2df02b601c28f2fad1a6d50f7347507..239ecdfcba6373e30336c7e8e3a4e028c45ec672 100644 (file)
@@ -1071,7 +1071,7 @@ get_header (char *header, struct headers *table)
     struct headers *h;
 
     for (h = table; h->value; h++)
     struct headers *h;
 
     for (h = table; h->value; h++)
-       if (!mh_strcasecmp (header, h->value))
+       if (!strcasecmp (header ? header : "", h->value ? h->value : ""))
            return (h - table);
 
     return NOTOK;
            return (h - table);
 
     return NOTOK;
@@ -1172,9 +1172,11 @@ insert (struct mailname *np)
            : &netaddrs;
            mp->m_next;
            mp = mp->m_next)
            : &netaddrs;
            mp->m_next;
            mp = mp->m_next)
-       if (!mh_strcasecmp (np->m_host, mp->m_next->m_host)
-               && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox)
-               && np->m_bcc == mp->m_next->m_bcc)
+       if (!strcasecmp (np->m_host ? np->m_host : "",
+                        mp->m_next->m_host ? mp->m_next->m_host : "") &&
+           !strcasecmp (np->m_mbox ? np->m_mbox : "",
+                        mp->m_next->m_mbox ? mp->m_next->m_mbox : "") &&
+           np->m_bcc == mp->m_next->m_bcc)
            return 0;
 
     mp->m_next = np;
            return 0;
 
     mp->m_next = np;
index a7a214bf538ad69ac735b7e420510148818d4e89..1aff02e678ca500b97f51bded26222fb7bbca81f 100644 (file)
@@ -387,8 +387,10 @@ insert (struct mailname *np)
        return 0;
 
     for (mp = &mq; mp->m_next; mp = mp->m_next) {
        return 0;
 
     for (mp = &mq; mp->m_next; mp = mp->m_next) {
-       if (!mh_strcasecmp (np->m_host, mp->m_next->m_host)
-               && !mh_strcasecmp (np->m_mbox, mp->m_next->m_mbox))
+       if (!strcasecmp (np->m_host ? np->m_host : "",
+                        mp->m_next->m_host ? mp->m_next->m_host : "")  &&
+           !strcasecmp (np->m_mbox ? np->m_mbox : "",
+                        mp->m_next->m_mbox ? mp->m_next->m_mbox : ""))
            return 0;
     }
     if (!ccme && ismymbox (np))
            return 0;
     }
     if (!ccme && ismymbox (np))
index ea6b805ee0bcf9bf8792abbc6fc1ab74ea8be893..452b774abbce9359aff5927bb0170f0fec2ea3dd 100644 (file)
@@ -368,7 +368,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
        case FLD:
        case FLDPLUS:
            compnum++;
        case FLD:
        case FLDPLUS:
            compnum++;
-           if (!mh_strcasecmp (nam, datesw)) {
+           if (!strcasecmp (nam, datesw)) {
                datecomp = add (buf, datecomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
                datecomp = add (buf, datecomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
@@ -377,7 +377,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
                }
                if (!subjsort || subjcomp)
                    break;
                }
                if (!subjsort || subjcomp)
                    break;
-           } else if (subjsort && !mh_strcasecmp (nam, subjsort)) {
+           } else if (subjsort && !strcasecmp (nam, subjsort)) {
                subjcomp = add (buf, subjcomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
                subjcomp = add (buf, subjcomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;