]> granicus.if.org Git - mutt/commitdiff
Experimental patch to fix #1318.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Dec 2002 18:26:26 +0000 (18:26 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Dec 2002 18:26:26 +0000 (18:26 +0000)
rfc822.c

index 78552da7411c4f326a00edb6048c4c7736882f52..797f2d9462f447eeb604210353df5f429d0596c2 100644 (file)
--- 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);
   }