From 6e211fb910bdc2eaa26d41c7c08cf142318387b3 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Mon, 9 Dec 2002 18:26:26 +0000 Subject: [PATCH] Experimental patch to fix #1318. --- rfc822.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rfc822.c b/rfc822.c index 78552da74..797f2d946 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); } -- 2.40.0