Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 27 Feb 2005 00:55:44 +0000 (00:55 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 27 Feb 2005 00:55:44 +0000 (00:55 +0000)
fixed bug in address parsing that bothered me for _years_

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@94 e385b8ad-14ed-0310-8656-cc95a2468c6d

parse.c

diff --git a/parse.c b/parse.c
index b8fa55f..6a07654 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -1057,6 +1057,15 @@ int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p, short
     if (!ascii_strcasecmp ("rom", line + 1))
     {
       e->from = rfc822_parse_adrlist (e->from, p);
+      /* don't leave from info NULL if there's an invalid address (or
+       * whatever) in From: field; mutt would just display it as empty
+       * and mark mail/(esp.) news article as your own. aaargh! this
+       * bothered me for _years_ */
+      if (!e->from)
+      {
+        e->from = rfc822_new_address ();
+        e->from->personal = safe_strdup (line+6);
+      }
       matched = 1;
     }
 #ifdef USE_NNTP