addrcheck: Take the domain as following the last `@', not the first.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 6 Apr 2006 11:25:37 +0000 (12:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 6 Apr 2006 11:25:37 +0000 (12:25 +0100)
This was just a silly mistake on my part.  Now we follow the spec in
addresses.5 properly.

.gitignore
Makefile
TARGETS
addrcheck.c

index f4c3f19..38cb632 100644 (file)
@@ -167,3 +167,4 @@ tcp-env.0
 tcp-environ.0
 uint32.h
 qmail-valid-addresses.0
+addrcheck-test
index f3d8ebd..7fbef63 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,12 @@ SHELL=/bin/sh
 
 default: it
 
+addrcheck-test.o: addrcheck.c
+       ./compile -DTEST -o addrcheck-test.o addrcheck.c
+addrcheck-test: \
+load addrcheck-test.o cdb.a wait.a stralloc.a alloc.a error.a str.a
+       ./load addrcheck-test cdb.a wait.a stralloc.a alloc.a error.a str.a
+
 addresses.0: \
 addresses.5
        nroff -man addresses.5 > addresses.0
diff --git a/TARGETS b/TARGETS
index 175aab7..e8868cd 100644 (file)
--- a/TARGETS
+++ b/TARGETS
@@ -386,3 +386,5 @@ forgeries.0
 man
 setup
 check
+addrcheck-test.o
+addrcheck-test
index 0b189a7..63281a3 100644 (file)
@@ -264,7 +264,7 @@ int addrcheck(int cdb, const char *addr, const char *sender, int *rc)
   static stralloc l = STRALLOC_INIT;
 
   len = str_len(addr);
-  at = str_chr(addr, '@');
+  at = str_rchr(addr, '@');
   if (!addr[at])
     return (local(cdb, addr, len, sender, rc));