]> diplodocus.org Git - nmh/blobdiff - sbr/mf.c
A better fix than e87f37c27828723317a71291e31b34f39ec09098, because
[nmh] / sbr / mf.c
index c88681787e5a72297eeb3880123b5e3eded978b4..136f94cd5d918f7927213c9c6a69aa3da7776a18 100644 (file)
--- a/sbr/mf.c
+++ b/sbr/mf.c
@@ -21,7 +21,6 @@ static int local_part (char *);
 static int domain (char *);
 static int route (char *);
 static int my_lex (char *);
-static int contains8bit (const char *);
 
 
 int
@@ -66,7 +65,7 @@ isat (const char *p)
  * 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
- * 733 syntax as well.  Most problems arise from trying to accomodate both.
+ * 733 syntax as well.  Most problems arise from trying to accommodate both.
  *
  * In terms of 822, the route-specification in 
  *
@@ -175,8 +174,9 @@ static char adr[BUFSIZ];
 static struct adrx  adrxs2;
 
 
+/* eai = Email Address Internationalization */
 struct adrx *
-getadrx (const char *addrs)
+getadrx (const char *addrs, int eai)
 {
     register char *bp;
     register struct adrx *adrxp = &adrxs2;
@@ -231,13 +231,15 @@ getadrx (const char *addrs)
            break;
        }
 
-    /*
-     * Reject the address if key fields contain 8bit characters
-     */
+    if (! eai) {
+        /*
+         * Reject the address if key fields contain 8bit characters
+         */
 
-    if (contains8bit(mbox) || contains8bit(host) || contains8bit(path) ||
-       contains8bit(grp)) {
-       strcpy(err, "Address contains 8-bit characters");
+        if (contains8bit(mbox, NULL) || contains8bit(host, NULL) ||
+            contains8bit(path, NULL) || contains8bit(grp, NULL)) {
+            strcpy(err, "Address contains 8-bit characters");
+        }
     }
 
     if (err[0])
@@ -728,25 +730,6 @@ got_atom: ;
 }
 
 
-/*
- * Return true if the string contains an 8-bit character
- */
-
-static int
-contains8bit(const char *p)
-{
-    if (! p)
-       return 0;
-
-    for (; *p; p++) {
-       if (! isascii((unsigned char) *p))
-           return 1;
-    }
-
-    return 0;
-}
-
-
 char *
 legal_person (const char *p)
 {