X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fmf.c;h=17809976ad9bc04175f2252eb2276cf93a92c0e2;hb=8aeebaf757a1588ae2836965f5443ca7dc3a0257;hp=53752a34e2088af8dd5d4e1e2299e783e7a3fd3c;hpb=d3ba09a465cb0e5fc9a74d0b152a7ed965f895cb;p=mmh diff --git a/sbr/mf.c b/sbr/mf.c index 53752a3..1780997 100644 --- a/sbr/mf.c +++ b/sbr/mf.c @@ -10,12 +10,14 @@ #include #include #include +#include +#include +#include /* ** static prototypes */ static char *getcpy(char *); -static int isat(char *); static int parse_address(void); static int phrase(char *); static int route_addr(char *); @@ -46,25 +48,12 @@ getcpy(char *s) } -#define CHKADR 0 /* undertermined address style */ -#define UNIXDR 1 /* UNIX-style address */ -#define ARPADR 2 /* ARPAnet-style address */ - - -static int -isat(char *p) -{ - return (strncmp(p, " AT ", 4)!=0 && strncmp(p, " At ", 4)!=0 && - strncmp(p, " aT ", 4)!=0 && strncmp(p, " at ", 4)!=0 ? - FALSE : TRUE); -} - - /* ** ** getadrx() implements a partial 822-style address parser. The parser ** is neither complete nor correct. It does however recognize nearly all -** of the 822 address syntax. In addition it handles the majority of the +** of the 822 address syntax. +** Historically, it handled the majority (and still handles parts) of the ** 733 syntax as well. Most problems arise from trying to accomodate both. ** ** In terms of 822, the route-specification in @@ -75,8 +64,6 @@ isat(char *p) ** via source-routing. Recursive groups are not allowed as per the ** standard. ** -** In terms of 733, " at " is recognized as equivalent to "@". -** ** In terms of both the parser will not complain about missing hosts. ** ** ----- @@ -555,7 +542,7 @@ route(char *buffer) default: sprintf(err, "no at-sign found for next domain in route (%s)", - buffer); + buffer); } break; } @@ -582,7 +569,7 @@ static int my_lex(char *buffer) { /* buffer should be at least BUFSIZ bytes long */ - int i, gotat = 0; + int i; register unsigned char c; register char *bp; @@ -602,7 +589,6 @@ my_lex(char *buffer) if (!cp) return (last_lex = LX_END); - gotat = isat(cp); c = *cp++; while (isspace(c)) c = *cp++; @@ -712,9 +698,7 @@ got_atom: ; else cp--; *bp = 0; - last_lex = !gotat || cp == NULL || strchr(cp, '<') != NULL - ? LX_ATOM : LX_AT; - return last_lex; + return LX_ATOM; my_lex_buffull: /* Out of buffer space. *bp is the last byte in the buffer */