]> diplodocus.org Git - nmh/commitdiff
More replacements of mh_strcasecmp() with strcasecmp().
authorDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 18:23:59 +0000 (13:23 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 18:23:59 +0000 (13:23 -0500)
sbr/check_charset.c
sbr/context_del.c
sbr/context_find.c
sbr/context_replace.c
sbr/fmt_compile.c
sbr/fmt_rfc2047.c
sbr/lock_file.c
sbr/ruserpass.c

index 8ee93b1e22209367c19c31f2ed76d9d3d9c0c7f4..e43459ef6a41c23b180fc3971927aa84e9233a15 100644 (file)
@@ -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) ||
 
        /* 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);
        }
            alt_charset = "US-ASCII";
            alt_len = strlen (alt_charset);
        }
index 474e51c890eb44aea3cab304eb72c2baa3b7d62a..e6cdc73dddd6a0090cf757a4f972754054660522 100644 (file)
@@ -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) {
     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)
            if (!np->n_context)
                admonish (NULL, "bug: context_del(key=\"%s\")", np->n_name);
            if (pp)
index 8c0675f71b171e41f5aa37e850699ddc4b058ff9..7c809ec180d2bf69e2e5cbc89ad101b2214cd153 100644 (file)
@@ -16,7 +16,7 @@ context_find (char *str)
     struct node *np;
 
     for (np = m_defs; np; np = np->n_next)
     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;
            return (np->n_field);
 
     return NULL;
index a0c503282cb3896998ffee197d7400c436b21e81..bceb9dfdecde97f018573b42b75fc3bcc9886507 100644 (file)
@@ -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) {
      * 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);
            if (strcmp (value, np->n_field)) {
                if (!np->n_context)
                    admonish (NULL, "bug: context_replace(key=\"%s\",value=\"%s\")", key, value);
index 0fd83d1e47af8333e305bb6ee037416418e3f9c3..23e0726382094e5603db0b41af451910e2386ff1 100644 (file)
@@ -873,7 +873,7 @@ fmt_freecomptext(void)
                cm->c_text = NULL;
            }
 }
                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.
 /*
  * 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)
     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;
            break;
 
     return cm;
@@ -951,18 +951,18 @@ fmt_addcomptext(char *component, char *text)
     char *cp;
 
     while (cptr) {
     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) {
            found++;
            if (! cptr->c_text) {
-               cptr->c_text = getcpy(text);
+               cptr->c_text = getcpy(text);
            } else {
            } 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) {
                if (cp[i] == '\n') {
                    if (cptr->c_type & CT_ADDR) {
-                       cp[i] = '\0';
+                       cp[i] = '\0';
                        cp = add(",\n\t", cp);
                    } else {
                        cp = add(",\n\t", cp);
                    } else {
-                       cp = add("\t", cp);
+                       cp = add("\t", cp);
                    }
                }
                cptr->c_text = add(text, 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 (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);
     }
 }
                cptr->c_text = add(text, cptr->c_text);
     }
 }
index 7f73efd20009c36000d3d7cca89ab32c8f851f55..fea731308631f5983a1bf07a01e49351bc0c16b0 100644 (file)
@@ -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);
                /* .. 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;
                *pp = '?';
                 if (cd == (iconv_t)-1) continue;
                use_iconv = 1;
index 987b922ced9076b12879a6a65dd56db825b03909..13a16029cbaa2eeb597260cdcaaaab008fa2c9a9 100644 (file)
@@ -745,21 +745,21 @@ alrmser (int sig)
 static enum locktype
 init_locktype(const char *lockname)
 {
 static enum locktype
 init_locktype(const char *lockname)
 {
-    if (mh_strcasecmp(lockname, "fcntl") == 0) {
+    if (strcasecmp(lockname, "fcntl") == 0) {
        return FCNTL_LOCKING;
        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 */
 #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 */
 #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);
        return DOT_LOCKING;
     } else {
        adios(NULL, "Unknown lock type: \"%s\"", lockname);
index 882889c374854a387c1d3f68859dcfea22514842..d422f67d31d2a042d0339a2ace1ebeafd22deab6 100644 (file)
@@ -90,7 +90,7 @@ ruserpass(char *host, char **aname, char **apass)
                /*
                 * Allow match either for user's host name.
                 */
                /*
                 * Allow match either for user's host name.
                 */
-               if (mh_strcasecmp(host, tokval) == 0)
+               if (strcasecmp(host, tokval) == 0)
                    goto match;
                continue;
            }
                    goto match;
                continue;
            }