aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-07-27 06:54:52 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-07-27 06:54:52 +0000
commitc2efa945dfd7105849c17cffa3210f9d004545f2 (patch)
tree8d0201ac9b2c6474f43112f916e1ecb02e1d4309 /driver.c
parentdf243ce2079a41644c90797ca606c64dc8e860db (diff)
downloadfetchmail-c2efa945dfd7105849c17cffa3210f9d004545f2.tar.gz
fetchmail-c2efa945dfd7105849c17cffa3210f9d004545f2.tar.bz2
fetchmail-c2efa945dfd7105849c17cffa3210f9d004545f2.zip
Improved Receive parsing.
svn path=/trunk/; revision=2026
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/driver.c b/driver.c
index f0099158..6abe5c48 100644
--- a/driver.c
+++ b/driver.c
@@ -284,16 +284,23 @@ static char *parse_received(struct query *ctl, char *bufp)
(ok = strstr(sp, "for ")) &&
isspace(ok[-1]))
{
+ flag want_gt = FALSE;
+
tp = rbuf;
sp = ok + 4;
- *tp++ = ':'; /* Here is the hack. This is to be friend */
+ *tp++ = ':'; /* Here is the hack. This is to be friends */
*tp++ = ' '; /* with nxtaddr()... */
if (*sp == '<')
+ {
+ want_gt = TRUE;
sp++;
+ }
while (*sp == '@') /* skip routes */
while (*sp && *sp++ != ':')
continue;
- while (*sp && *sp != '>' && *sp != ';')
+ while (*sp
+ && (want_gt ? (*sp != '>') : !isspace(*sp))
+ && *sp != ';')
if (!isspace(*sp))
*tp++ = *sp++;
else