new find_email_adr.c
This patch to my previous post removes two debugging statements, and fixes a bug that showed up when people used bare email addresses in the headers. For instance:
instead of
To: Neale Pickett <[email protected]>
would trigger the bug (and bounce email).
I don't know if anybody's even tried my new find_email_adr.c, I haven't gotten any feedback on it yet. It works for me, so far. You can find the whole file--which fixes email-parsing problems (I think), and which may be dropped into src/--at http://woozle.org/~neale/repos/mlmmj/src/find_email_adr.c (part of a darcs repository).
Neale
--- find_email_adr.c 2005-10-10 13:14:54.000000000 -0600
+++ /home/neale/src/import/mlmmj/src/find_email_adr.c 2005-10-30
20:07:40.000000000 -0700
@@ -83,12 +83,16 @@
if (name = NULL)
return (NULL);
- if (strchr(name, '(') = NULL && strchr(name, '<') = NULL
- && strchr(name, ' ') = NULL)
- return (name);
/* We assume that length(input) <= length(output) */ nbuf = mymalloc(strlen(name) + 1);
+
+ if (strchr(name, '(') = NULL && strchr(name, '<') = NULL
+ && strchr(name, ' ') = NULL) {
+ strcpy(nbuf, name);
+ return (nbuf);
+ }
+
gotlt = 0;
lastsp = 0;
bufend = nbuf;
@@ -200,7 +204,6 @@
p += 1;
}
- printf("cur: %s\n", cur);
while(cur && ((' ' = *cur) ||
('\t' = *cur) ||
('\r' = *cur) ||@@ -213,7 +216,6 @@
adr = skin(cur);
if (adr) {
- printf("adr: %s\n", adr);
retstruct->emailcount++;
retstruct->emaillist = (char **)myrealloc(retstruct->emaillist,
sizeof(char *) * retstruct->emailcount);
Quoted 3 lines · Neale Pickett
This patch to my previous post removes two debugging statements, and fixes a bug that showed up when people used bare email addresses in the headers. For instance:
Great! Can you make it against 1.2.9-RC1 and resend it? It fails to apply here.
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?"
-- A. P. J.Quoted 7 lines · Mads Martin Joergensen
Quoted 3 lines · Neale Pickett
This patch to my previous post removes two debugging statements, and fixes a bug that showed up when people used bare email addresses in the headers. For instance:
Great! Can you make it against 1.2.9-RC1 and resend it? It fails to apply here.
It's against the whole file I sent a while ago. If you don't have that file around, you can download it (with my patch applied):
http://woozle.org/~neale/repos/mlmmj/src/find_email_adr.c
No sense sending a patch against RC1, since the entire file's been rewritten. :)
Neale
Quoted 10 lines · Neale Pickett
Quoted 6 lines
Quoted 3 lines
This patch to my previous post removes two debugging statements, and fixes a bug that showed up when people used bare email addresses in the headers. For instance:
Great! Can you make it against 1.2.9-RC1 and resend it? It fails to apply here.
It's against the whole file I sent a while ago. If you don't have that file around, you can download it (with my patch applied):
http://woozle.org/~neale/repos/mlmmj/src/find_email_adr.c
Got it.
Quoted 2 lines
No sense sending a patch against RC1, since the entire file's been rewritten. :)
DOH, sorry. I was absolutely convinced I already merged it, since it was my attention to do so.
There's going to be 1.2.9-RC2 with this one.
Thanks!
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?"
-- A. P. J.