From: David Levine Date: Sun, 24 Mar 2013 18:23:59 +0000 (-0500) Subject: More replacements of mh_strcasecmp() with strcasecmp(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d66378909931a74ed83e29d592982eaa3e7e0107?hp=da35ab7c7664b221aba2d761d0f051c57313e16e More replacements of mh_strcasecmp() with strcasecmp(). --- diff --git a/sbr/check_charset.c b/sbr/check_charset.c index 8ee93b1e..e43459ef 100644 --- a/sbr/check_charset.c +++ b/sbr/check_charset.c @@ -51,7 +51,7 @@ check_charset (char *str, int len) /* US-ASCII is a subset of the ISO-8859-X and UTF-8 character sets */ if (!strncasecmp("ISO-8859-", mm_charset, 9) || - !mh_strcasecmp("UTF-8", mm_charset)) { + !strcasecmp("UTF-8", mm_charset)) { alt_charset = "US-ASCII"; alt_len = strlen (alt_charset); } diff --git a/sbr/context_del.c b/sbr/context_del.c index 474e51c8..e6cdc73d 100644 --- a/sbr/context_del.c +++ b/sbr/context_del.c @@ -20,7 +20,7 @@ context_del (char *key) register struct node *np, *pp; for (np = m_defs, pp = NULL; np; pp = np, np = np->n_next) { - if (!mh_strcasecmp (np->n_name, key)) { + if (!strcasecmp (np->n_name ? np->n_name : "", key ? key : "")) { if (!np->n_context) admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name); if (pp) diff --git a/sbr/context_find.c b/sbr/context_find.c index 8c0675f7..7c809ec1 100644 --- a/sbr/context_find.c +++ b/sbr/context_find.c @@ -16,7 +16,7 @@ context_find (char *str) struct node *np; for (np = m_defs; np; np = np->n_next) - if (!mh_strcasecmp (np->n_name, str)) + if (!strcasecmp (np->n_name ? np->n_name : "", str ? str : "")) return (np->n_field); return NULL; diff --git a/sbr/context_replace.c b/sbr/context_replace.c index a0c50328..bceb9dfd 100644 --- a/sbr/context_replace.c +++ b/sbr/context_replace.c @@ -36,7 +36,7 @@ context_replace (char *key, char *value) * this key, and replace its value if found. */ for (np = m_defs;; np = np->n_next) { - if (!mh_strcasecmp (np->n_name, key)) { + if (!strcasecmp (np->n_name ? np->n_name : "", key ? key : "")) { if (strcmp (value, np->n_field)) { if (!np->n_context) admonish (NULL, "bug: context_replace(key=\"%s\",value=\"%s\")", key, value); diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 0fd83d1e..23e07263 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -873,7 +873,7 @@ fmt_freecomptext(void) cm->c_text = NULL; } } - + /* * Find a component in our hash table. This is just a public interface to * the FINDCOMP macro, so we don't have to expose our hash table. @@ -899,7 +899,7 @@ fmt_findcasecomp(char *component) struct comp *cm; for (cm = wantcomp[CHASH(component)]; cm; cm = cm->c_next) - if (mh_strcasecmp(component, cm->c_name) == 0) + if (strcasecmp(component, cm->c_name ? cm->c_name : "") == 0) break; return cm; @@ -951,18 +951,18 @@ fmt_addcomptext(char *component, char *text) char *cp; while (cptr) { - if (mh_strcasecmp(component, cptr->c_name) == 0) { + if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) { found++; if (! cptr->c_text) { - cptr->c_text = getcpy(text); + cptr->c_text = getcpy(text); } else { - i = strlen(cp = cptr->c_text) - 1; + i = strlen(cp = cptr->c_text) - 1; if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { - cp[i] = '\0'; + cp[i] = '\0'; cp = add(",\n\t", cp); } else { - cp = add("\t", cp); + cp = add("\t", cp); } } cptr->c_text = add(text, cp); @@ -986,7 +986,7 @@ fmt_appendcomp(int bucket, char *component, char *text) if (bucket != -1) { for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next) - if (mh_strcasecmp(component, cptr->c_name) == 0) + if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) cptr->c_text = add(text, cptr->c_text); } } diff --git a/sbr/fmt_rfc2047.c b/sbr/fmt_rfc2047.c index 7f73efd2..fea73130 100644 --- a/sbr/fmt_rfc2047.c +++ b/sbr/fmt_rfc2047.c @@ -147,7 +147,7 @@ decode_rfc2047 (char *str, char *dst, size_t dstlen) /* .. it can't. We'll use iconv then. */ *endofcharset = '\0'; cd = iconv_open(get_charset(), startofmime); - fromutf8 = !mh_strcasecmp(startofmime, "UTF-8"); + fromutf8 = !strcasecmp(startofmime, "UTF-8"); *pp = '?'; if (cd == (iconv_t)-1) continue; use_iconv = 1; diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 987b922c..13a16029 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -745,21 +745,21 @@ alrmser (int sig) static enum locktype init_locktype(const char *lockname) { - if (mh_strcasecmp(lockname, "fcntl") == 0) { + if (strcasecmp(lockname, "fcntl") == 0) { return FCNTL_LOCKING; - } else if (mh_strcasecmp(lockname, "lockf") == 0) { + } else if (strcasecmp(lockname, "lockf") == 0) { #ifdef HAVE_LOCKF return LOCKF_LOCKING; #else /* ! HAVE_LOCKF */ adios(NULL, "lockf not supported on this system"); #endif /* HAVE_LOCKF */ - } else if (mh_strcasecmp(lockname, "flock") == 0) { + } else if (strcasecmp(lockname, "flock") == 0) { #ifdef HAVE_FLOCK return FLOCK_LOCKING; #else /* ! HAVE_FLOCK */ adios(NULL, "flock not supported on this system"); #endif /* HAVE_FLOCK */ - } else if (mh_strcasecmp(lockname, "dot") == 0) { + } else if (strcasecmp(lockname, "dot") == 0) { return DOT_LOCKING; } else { adios(NULL, "Unknown lock type: \"%s\"", lockname); diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 882889c3..d422f67d 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -90,7 +90,7 @@ ruserpass(char *host, char **aname, char **apass) /* * Allow match either for user's host name. */ - if (mh_strcasecmp(host, tokval) == 0) + if (strcasecmp(host, tokval) == 0) goto match; continue; }