X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/47dca82001bf41dcd6954f72d2d27e3fbc2e8e9d..df02833a36f5525edb5b274fb67ca46aa4e5e6c5:/uip/aliasbr.c diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 49372510..6600f741 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 *); @@ -104,6 +104,12 @@ akval (struct aka *ak, char *s) if (!s) return s; /* XXX */ + /* It'd be tempting to check for a trailing semicolon and remove + it. But that would break the EXMH alias parser on what would + then be valid expressions: + http://lists.gnu.org/archive/html/nmh-workers/2012-10/msg00039.html + */ + for (; ak; ak = ak->ak_next) { if (aleq (s, ak->ak_name)) { return akresult (ak); @@ -120,7 +126,7 @@ akval (struct aka *ak, char *s) if (name) { /* s is of the form "Blind list: address". If address is an alias, expand it. */ - struct mailname *mp = getm (name, NULL, 0, AD_NAME, NULL); + struct mailname *mp = getm (name, NULL, 0, NULL, 0); if (mp && mp->m_ingrp) { char *gname = add (mp->m_gname, NULL); @@ -313,9 +319,9 @@ akerror (int i) static char * -scanp (unsigned char *p) +scanp (char *p) { - while (isspace (*p)) + while (isspace ((unsigned char) *p)) p++; return p; } @@ -324,10 +330,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; @@ -338,10 +344,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; @@ -456,7 +462,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) @@ -466,7 +472,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); @@ -478,7 +484,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;