summaryrefslogtreecommitdiffstats
path: root/rfc822.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2002-12-09 18:26:26 +0000
committerThomas Roessler <roessler@does-not-exist.org>2002-12-09 18:26:26 +0000
commit8a24627898025ccf0448dd3c4681a2bf78e31446 (patch)
tree110c86d92933fa083cab98038a6b39d80aa113d7 /rfc822.c
parentd4b0e0d96914ece6bade2eb2552d4a4eb6526ed8 (diff)
Experimental patch to fix #1318.
Diffstat (limited to 'rfc822.c')
-rw-r--r--rfc822.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rfc822.c b/rfc822.c
index 78552da7..797f2d94 100644
--- a/rfc822.c
+++ b/rfc822.c
@@ -331,6 +331,7 @@ add_addrspec (ADDRESS **top, ADDRESS **last, const char *phrase,
ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s)
{
+ int ws_pending;
const char *begin, *ps;
char comment[STRING], phrase[STRING];
size_t phraselen = 0, commentlen = 0;
@@ -342,6 +343,8 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s)
while (last && last->next)
last = last->next;
+ ws_pending = isspace (*s);
+
SKIPWS (s);
begin = s;
while (*s)
@@ -465,7 +468,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s)
}
else
{
- if (phraselen && phraselen < sizeof (phrase) - 1 && *s != '.')
+ if (phraselen && phraselen < sizeof (phrase) - 1 && ws_pending)
phrase[phraselen++] = ' ';
if ((ps = next_token (s, phrase, &phraselen, sizeof (phrase) - 1)) == NULL)
{
@@ -474,6 +477,7 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s)
}
s = ps;
}
+ ws_pending = isspace (*s);
SKIPWS (s);
}