X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d8a78332490cd5a5928d6a23d06797ca9caa2b45..e0e0c1e0fce54f31e8b126d78a0b364208f7d36f:/uip/aliasbr.c diff --git a/uip/aliasbr.c b/uip/aliasbr.c index d8350f9d..a696e8a6 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -35,7 +35,7 @@ char *akerror (int); static char *akval (struct aka *, char *); static int aleq (char *, char *); -static char *scanp (unsigned char *); +static char *scanp (char *); static char *getp (char *); static char *seekp (char *, char *, char **); static int addfile (struct aka *, char *); @@ -46,7 +46,6 @@ static char *getalias (char *); static void add_aka (struct aka *, char *); static struct aka *akalloc (char *); static struct home *hmalloc (struct passwd *); -struct home *seek_home (char *); /* Do mh alias substitution on 's' and return the results. */ @@ -314,9 +313,9 @@ akerror (int i) static char * -scanp (unsigned char *p) +scanp (char *p) { - while (isspace (*p)) + while (isspace ((unsigned char) *p)) p++; return p; } @@ -325,10 +324,10 @@ scanp (unsigned char *p) static char * getp (char *p) { - register unsigned char *cp = scanp (p); + char *cp = scanp (p); p = cp; - while (!isspace (*cp) && *cp) + while (!isspace ((unsigned char) *cp) && *cp) cp++; *cp = 0; @@ -339,10 +338,10 @@ getp (char *p) static char * seekp (char *p, char *c, char **a) { - register unsigned char *cp; + char *cp; p = cp = scanp (p); - while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';') + while (!isspace ((unsigned char) *cp) && *cp && *cp != ':' && *cp != ';') cp++; *c = *cp; *cp++ = 0; @@ -457,7 +456,7 @@ addall (struct aka *ak) static char * getalias (char *addrs) { - register unsigned char *pp, *qp; + char *pp, *qp; static char *cp = NULL; if (cp == NULL) @@ -467,7 +466,7 @@ getalias (char *addrs) return (cp = NULL); /* Remove leading any space from the address. */ - for (pp = cp; isspace (*pp); pp++) + for (pp = cp; isspace ((unsigned char) *pp); pp++) continue; if (*pp == 0) return (cp = NULL); @@ -479,7 +478,7 @@ getalias (char *addrs) *qp++ = 0; for (cp = qp, qp--; qp > pp; qp--) if (*qp != 0) { - if (isspace (*qp)) + if (isspace ((unsigned char) *qp)) *qp = 0; else break; @@ -577,36 +576,3 @@ hmalloc (struct passwd *pw) return p; } - - -struct home * -seek_home (char *name) -{ - register struct home *hp; - struct passwd *pw; - char lname[32]; - unsigned char *c; - char *c1; - - for (hp = homehead; hp; hp = hp->h_next) - if (!mh_strcasecmp (name, hp->h_name)) - return hp; - - /* - * The only place where there might be problems. - * This assumes that ALL usernames are kept in lowercase. - */ - for (c = name, c1 = lname; - *c && (c1 - lname < (int) sizeof(lname) - 1); - c++, c1++) { - if (isalpha(*c) && isupper(*c)) - *c1 = tolower (*c); - else - *c1 = *c; - } - *c1 = '\0'; - if ((pw = getpwnam(lname))) - return(hmalloc(pw)); - - return NULL; -}