]> diplodocus.org Git - nmh/blobdiff - uip/aliasbr.c
getpass.c: Move interface to own file.
[nmh] / uip / aliasbr.c
index 7266c8316b62fd7fa17ca209e641d97857e5c587..40c9ca19bbcfb357319798243d3a5f68c0f6da5a 100644 (file)
@@ -5,10 +5,12 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/aliasbr.h>
-#include <h/addrsbr.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "sbr/vfgets.h"
+#include "sbr/getcpy.h"
+#include "h/aliasbr.h"
+#include "h/addrsbr.h"
+#include "h/utils.h"
 #include <pwd.h>
 
 static int akvis;
@@ -20,15 +22,9 @@ struct aka *akatail = NULL;
 /*
  * prototypes
  */
-int alias (char *);
-int akvisible (void);
-char *akresult (struct aka *);
-char *akvalue (char *);
-char *akerror (int);
-
 static  char *akval (struct aka *, char *);
-static bool aleq (char *, char *);
-static char *scanp (char *);
+static bool aleq (char *, char *) PURE;
+static char *scanp (char *) PURE;
 static char *getp (char *);
 static char *seekp (char *, char *, char **);
 static int addfile (struct aka *, char *);
@@ -120,7 +116,7 @@ akval (struct aka *ak, char *s)
                struct mailname *mp = getm (name, NULL, 0, NULL, 0);
 
                if (mp  &&  mp->m_ingrp) {
-                   char *gname = add (mp->m_gname, NULL);
+                   char *gname = mh_xstrdup(FENDNULL(mp->m_gname));
 
                     /* FIXME: gname must be true;  add() never returns NULL.
                     * Is some other test required? */
@@ -160,7 +156,7 @@ aleq (char *string, char *aliasent)
         aliasent++;
     }
 
-    return (*aliasent == 0 || *aliasent == '*');
+    return *aliasent == 0 || *aliasent == '*';
 }
 
 
@@ -348,15 +344,14 @@ getalias (char *addrs)
 
     if (cp == NULL)
        cp = addrs;
-    else
-       if (*cp == 0)
-           return (cp = NULL);
+    else if (*cp == 0)
+        return cp = NULL;
 
     /* Remove leading any space from the address. */
     for (pp = cp; isspace ((unsigned char) *pp); pp++)
        continue;
     if (*pp == 0)
-       return (cp = NULL);
+       return cp = NULL;
     /* Find the end of the address. */
     for (qp = pp; *qp != 0 && *qp != ','; qp++)
        continue;