]> diplodocus.org Git - nmh/blobdiff - uip/aliasbr.c
Alter HasSuffixC()'s char * to be const.
[nmh] / uip / aliasbr.c
index 8462fbdce1ab2ebf40a2da0f337ec5afc5ec6264..c7ea3a33f02dc2b60e3fda722ae71c4e5a57aef0 100644 (file)
@@ -112,7 +112,9 @@ akval (struct aka *ak, char *s)
     for (; ak; ak = ak->ak_next) {
        if (aleq (s, ak->ak_name)) {
            return akresult (ak);
     for (; ak; ak = ak->ak_next) {
        if (aleq (s, ak->ak_name)) {
            return akresult (ak);
-       } else if (strchr (s, ':')) {
+       }
+
+        if (strchr (s, ':')) {
            /* The first address in a blind list will contain the
               alias name, so try to match, but just with just the
               address (not including the list name).  If there's a
            /* The first address in a blind list will contain the
               alias name, so try to match, but just with just the
               address (not including the list name).  If there's a
@@ -149,7 +151,7 @@ akval (struct aka *ak, char *s)
        }
     }
 
        }
     }
 
-    return getcpy (s);
+    return mh_xstrdup(s);
 }
 
 
 }
 
 
@@ -158,14 +160,13 @@ aleq (char *string, char *aliasent)
 {
     char c;
 
 {
     char c;
 
-    while ((c = *string++))
+    while ((c = *string++)) {
        if (*aliasent == '*')
            return 1;
        if (*aliasent == '*')
            return 1;
-       else
-           if ((c | 040) != (*aliasent | 040))
-               return 0;
-           else
-               aliasent++;
+        if ((c | 040) != (*aliasent | 040))
+            return 0;
+        aliasent++;
+    }
 
     return (*aliasent == 0 || *aliasent == '*');
 }
 
     return (*aliasent == 0 || *aliasent == '*');
 }
@@ -479,7 +480,7 @@ add_aka (struct aka *ak, char *pp)
            return;
 
     NEW(ad);
            return;
 
     NEW(ad);
-    ad->ad_text = getcpy (pp);
+    ad->ad_text = mh_xstrdup(pp);
     ad->ad_local = strchr(pp, '@') == NULL && strchr(pp, '!') == NULL;
     ad->ad_next = NULL;
     if (ak->ak_addr)
     ad->ad_local = strchr(pp, '@') == NULL && strchr(pp, '!') == NULL;
     ad->ad_next = NULL;
     if (ak->ak_addr)