All of lore.kernel.org
 help / color / mirror / Atom feed
* new find_email_adr.c
@ 2005-10-31  3:19 Neale Pickett
  2005-11-01 13:24 ` Mads Martin Joergensen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Neale Pickett @ 2005-10-31  3:19 UTC (permalink / raw)
  To: mlmmj

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:

  To: neale@woozle.org

instead of

  To: Neale Pickett <neale@woozle.org>

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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new find_email_adr.c
  2005-10-31  3:19 new find_email_adr.c Neale Pickett
@ 2005-11-01 13:24 ` Mads Martin Joergensen
  2005-11-01 14:40 ` Neale Pickett
  2005-11-01 19:34 ` Mads Martin Joergensen
  2 siblings, 0 replies; 4+ messages in thread
From: Mads Martin Joergensen @ 2005-11-01 13:24 UTC (permalink / raw)
  To: mlmmj

* Neale Pickett <neale@woozle.org> [Oct 31. 2005 04:21]:
> 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.

-- 
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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new find_email_adr.c
  2005-10-31  3:19 new find_email_adr.c Neale Pickett
  2005-11-01 13:24 ` Mads Martin Joergensen
@ 2005-11-01 14:40 ` Neale Pickett
  2005-11-01 19:34 ` Mads Martin Joergensen
  2 siblings, 0 replies; 4+ messages in thread
From: Neale Pickett @ 2005-11-01 14:40 UTC (permalink / raw)
  To: mlmmj

On Tuesday 01 November 2005 06:24 am, Mads Martin Joergensen wrote:
> * Neale Pickett <neale@woozle.org> [Oct 31. 2005 04:21]:
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new find_email_adr.c
  2005-10-31  3:19 new find_email_adr.c Neale Pickett
  2005-11-01 13:24 ` Mads Martin Joergensen
  2005-11-01 14:40 ` Neale Pickett
@ 2005-11-01 19:34 ` Mads Martin Joergensen
  2 siblings, 0 replies; 4+ messages in thread
From: Mads Martin Joergensen @ 2005-11-01 19:34 UTC (permalink / raw)
  To: mlmmj

* Neale Pickett <neale@woozle.org> [Nov 01. 2005 15:41]:
> > > 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.

> 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!
-- 
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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-01 19:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31  3:19 new find_email_adr.c Neale Pickett
2005-11-01 13:24 ` Mads Martin Joergensen
2005-11-01 14:40 ` Neale Pickett
2005-11-01 19:34 ` Mads Martin Joergensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.