X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=nntp%2Fnntp.c;h=64a64340c0d40bf8fa6526362a77dfab9b09dba6;hp=7121398e4ef1627c429b94226d59f7b5c95cbe37;hb=10847442af799c403bd67bf0291cc119e55d72ce;hpb=dba814e28104a395ffb52e16beccaecf09be8cde diff --git a/nntp/nntp.c b/nntp/nntp.c index 7121398..64a6434 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -570,23 +570,19 @@ static int nntp_parse_xover (CONTEXT * ctx, char *buf, HEADER * hdr) break; case 1: hdr->env->subject = str_dup (b); - /* Now we need to do the things which would normally be done in - * mutt_read_rfc822_header() */ - if (hdr->env->subject) { - regmatch_t pmatch[1]; - - rfc2047_decode (&hdr->env->subject); - - if (regexec (ReplyRegexp.rx, hdr->env->subject, 1, pmatch, 0) == 0) - hdr->env->real_subj = hdr->env->subject + pmatch[0].rm_eo; - else - hdr->env->real_subj = hdr->env->subject; - } break; case 2: rfc822_free_address (&hdr->env->from); hdr->env->from = rfc822_parse_adrlist (hdr->env->from, b); - rfc2047_decode_adrlist (hdr->env->from); + /* same as for mutt_parse_rfc822_line(): + * 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 (!hdr->env->from) { + hdr->env->from = rfc822_new_address (); + hdr->env->from->personal = str_dup (b); + } break; case 3: hdr->date_sent = mutt_parse_date (b, hdr); @@ -613,6 +609,7 @@ static int nntp_parse_xover (CONTEXT * ctx, char *buf, HEADER * hdr) hdr->env->xref = str_dup (b); nntp_parse_xref (ctx, nntp_data->group, b, hdr); } + rfc2047_decode_envelope (hdr->env); if (!*p) return -1; b = p;