]> diplodocus.org Git - nmh/commitdiff
Finished replacing mh_strcasecmp() with strcasecmp(). Removed
authorDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 18:37:47 +0000 (13:37 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 24 Mar 2013 18:37:47 +0000 (13:37 -0500)
sbr/strcasecmp.c.

Makefile.am
h/prototypes.h
sbr/message_id.c
sbr/mts.c
sbr/readconfig.c
sbr/strcasecmp.c [deleted file]

index 1e64f1592c4c06f7f0c68979a41270fb1bf56aac..338bba3877d11ac9dcb9a6fc0d106aba0f34dcaf 100644 (file)
@@ -544,7 +544,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
                      sbr/seq_print.c sbr/seq_read.c sbr/seq_save.c \
                      sbr/seq_setcur.c sbr/seq_setprev.c sbr/seq_setunseen.c \
                      sbr/showfile.c sbr/signals.c sbr/smatch.c \
-                     sbr/snprintb.c sbr/ssequal.c sbr/strcasecmp.c \
+                     sbr/snprintb.c sbr/ssequal.c \
                      sbr/strindex.c sbr/trimcpy.c sbr/uprf.c sbr/vfgets.c \
                      sbr/fmt_def.c sbr/mf.c sbr/utils.c sbr/ctype-checked.c \
                      sbr/m_mktemp.c sbr/getansreadline.c config/config.c \
index 484bef28648bcc48c578015c437bd631d18418e0..8fa31576cff2abb1a24bd0f60fac14927e65306b 100644 (file)
@@ -194,9 +194,6 @@ int uprf (char *, char *);
 int vfgets (FILE *, char **);
 char *write_charset_8bit (void);
 
-int mh_strcasecmp (const char *s1, const char *s2);
-int strncasecmp (const char *s1, const char *s2, size_t n);
-
 
 /*
  * some prototypes for address parsing system
index bb71313021501967de473e571a3d15de84efaf45..ce65ed9c9688a9c541ccf189df19089f2e6527a4 100644 (file)
@@ -23,10 +23,10 @@ static char message_id_[BUFSIZ];
 /* Convert name of message id style to integer value and store it. */
 int
 save_message_id_style (const char *value) {
-  if (! mh_strcasecmp (value, "localname")) {
+  if (! strcasecmp (value, "localname")) {
     message_id_style = NMH_MESSAGE_ID_LOCALNAME;
     return 0;
-  } else if (! mh_strcasecmp (value, "random")) {
+  } else if (! strcasecmp (value, "random")) {
     message_id_style = NMH_MESSAGE_ID_RANDOM;
     return 0;
   } else {
index 70dae02485e7268c261b91bf9c5e1ac1de10587b..f498615cb018b5a87e49e40ec537ff1a8225ed8b 100644 (file)
--- a/sbr/mts.c
+++ b/sbr/mts.c
@@ -125,14 +125,14 @@ static struct bind binds[] = {
 /* Convert name of mts method to integer value and store it. */
 void
 save_mts_method (const char *value) {
-    if (! mh_strcasecmp (value, "smtp")) {
+    if (! strcasecmp (value, "smtp")) {
         mts_method = "smtp";
         sm_mts = MTS_SMTP;
-    } else if (! mh_strcasecmp (value, "sendmail/smtp")  ||
-               ! mh_strcasecmp (value, "sendmail")) {
+    } else if (! strcasecmp (value, "sendmail/smtp")  ||
+               ! strcasecmp (value, "sendmail")) {
         mts_method = "sendmail/smtp";
         sm_mts = MTS_SENDMAIL_SMTP;
-    } else if (! mh_strcasecmp (value, "sendmail/pipe")) {
+    } else if (! strcasecmp (value, "sendmail/pipe")) {
         mts_method = "sendmail/pipe";
         sm_mts = MTS_SENDMAIL_PIPE;
     } else {
index be45823988e9ddbd89f859297704640f91b99cdb..866747a2ab6ce1bb50e424547076ef638eaf5294 100644 (file)
@@ -143,7 +143,7 @@ readconfig (struct node **npp, FILE *ib, char *file, int ctx)
            if (strlen (np->n_name) > 0  &&  strcmp ("#", np->n_name)) {
                struct node *np2;
                for (np2 = np->n_next; np2; np2 = np2->n_next) {
-                   if (! mh_strcasecmp (np->n_name, np2->n_name)) {
+                   if (! strcasecmp (np->n_name, np2->n_name)) {
                        admonish (NULL, "multiple \"%s\" profile components "
                                        "in %s, ignoring \"%s\"",
                                  np->n_name, defpath, np2->n_field);
diff --git a/sbr/strcasecmp.c b/sbr/strcasecmp.c
deleted file mode 100644 (file)
index c48c9d4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-
-/*
- * strcasecmp.c -- compare strings, ignoring case
- *
- * This code is Copyright (c) 2002, by the authors of nmh.  See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-
-/*
- * Our version of strcasecmp has to deal with NULL strings.
- * Once that is fixed in the rest of the code, we can use the
- * native version, instead of this one.
- */
-
-int
-mh_strcasecmp (const char *s1, const char *s2) 
-{
-    const unsigned char *us1, *us2;
-
-    us1 = (const unsigned char *) s1,
-    us2 = (const unsigned char *) s2;
-
-    if (!us1)
-       us1 = (const unsigned char *) "";
-    if (!us2)
-       us2 = (const unsigned char *) "";
-    while (tolower(*us1) == tolower(*us2++)) 
-       if (*us1++ == '\0')
-           return (0);
-    return (tolower(*us1) - tolower(*--us2));
-}
-
-int
-mh_strncasecmp (const char *s1, const char *s2, size_t n)
-{
-    const unsigned char *us1, *us2;
-
-    if (n != 0) { 
-       us1 = (const unsigned char *) s1,
-       us2 = (const unsigned char *) s2;
-
-       do {  
-           if (tolower(*us1) != tolower(*us2++))
-               return (tolower(*us1) - tolower(*--us2));
-           if (*us1++ == '\0')
-               break;  
-       } while (--n != 0);
-    } 
-    return (0);
-}