From: David Levine Date: Sun, 24 Mar 2013 16:45:42 +0000 (-0500) Subject: More replacements of mh_strcasecmp() with strcasecmp(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/da35ab7c7664b221aba2d761d0f051c57313e16e?hp=487ad115de1c5a97ab4e61bbf3f3bbbdbd97b258 More replacements of mh_strcasecmp() with strcasecmp(). --- diff --git a/uip/ali.c b/uip/ali.c index 3893a1d8..1fa7ef84 100644 --- 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; - 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); diff --git a/uip/fmttest.c b/uip/fmttest.c index 8b81924b..cbc3459a 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -1301,8 +1301,10 @@ insert (struct mailname *np) 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)) diff --git a/uip/mhmisc.c b/uip/mhmisc.c index 86b8ad80..895ec313 100644 --- a/uip/mhmisc.c +++ b/uip/mhmisc.c @@ -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++) - if (!mh_strcasecmp (*ap, ci->ci_type) || !mh_strcasecmp (*ap, buffer)) + if (!strcasecmp (*ap, ci->ci_type) || !strcasecmp (*ap, buffer)) return 1; return 0; diff --git a/uip/mhparam.c b/uip/mhparam.c index 414255ba..a1ca28f7 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -201,7 +201,7 @@ p_find(char *str) 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; diff --git a/uip/msh.c b/uip/msh.c index c1f0fc3a..cdec7664 100644 --- 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: - if (!mh_strcasecmp (name, BBoard_ID)) { + if (!strcasecmp (name, BBoard_ID)) { bp = getcpy (buf); while (state == FLDPLUS) { bufsz = sizeof buf; diff --git a/uip/picksbr.c b/uip/picksbr.c index ec7400a3..60354703 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -895,19 +895,19 @@ tws_special (char *ap) register struct tws *tw; time (&clock); - if (!mh_strcasecmp (ap, "today")) + if (!strcasecmp (ap, "today")) return dlocaltime (&clock); - if (!mh_strcasecmp (ap, "yesterday")) { + if (!strcasecmp (ap, "yesterday")) { 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++) - if (!mh_strcasecmp (ap, tw_ldotw[i])) + if (!strcasecmp (ap, tw_ldotw[i])) 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); } - if (!mh_strcasecmp (name, n->n_datef)) + if (!strcasecmp (name, n->n_datef)) break; continue; diff --git a/uip/post.c b/uip/post.c index 9b8bcbef..239ecdfc 100644 --- a/uip/post.c +++ b/uip/post.c @@ -1071,7 +1071,7 @@ get_header (char *header, struct headers *table) 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; @@ -1172,9 +1172,11 @@ insert (struct mailname *np) : &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; diff --git a/uip/replsbr.c b/uip/replsbr.c index a7a214bf..1aff02e6 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -387,8 +387,10 @@ insert (struct mailname *np) 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)) diff --git a/uip/sortm.c b/uip/sortm.c index ea6b805e..452b774a 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -368,7 +368,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg) case FLD: case FLDPLUS: compnum++; - if (!mh_strcasecmp (nam, datesw)) { + if (!strcasecmp (nam, datesw)) { 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; - } else if (subjsort && !mh_strcasecmp (nam, subjsort)) { + } else if (subjsort && !strcasecmp (nam, subjsort)) { subjcomp = add (buf, subjcomp); while (state == FLDPLUS) { bufsz = sizeof buf;