]> diplodocus.org Git - nmh/blobdiff - uip/aliasbr.c
Remove unused NCWD and NPWD #defines.
[nmh] / uip / aliasbr.c
index 039344165e22ed57f15d3bbc378b5bb8c711f380..069e454605f2367059c09915b3b67ba6649ced9b 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);
-       } 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
@@ -158,14 +160,13 @@ aleq (char *string, char *aliasent)
 {
     char c;
 
-    while ((c = *string++))
+    while ((c = *string++)) {
        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 == '*');
 }
@@ -181,7 +182,7 @@ alias (char *file)
     FILE *fp;
 
     if (*file != '/'
-           && (strncmp (file, "./", 2) && strncmp (file, "../", 3)))
+            && !HasPrefix(file, "./") && !HasPrefix(file, "../"))
        file = etcpath (file);
     if ((fp = fopen (file, "r")) == NULL) {
        akerrst = file;