On 06/21/2014 18:32, Kevin J. McCarthy wrote:
> Roger Cornelius wrote:
> > Below is a one line patch that allows bounce_message to work like
> > forward_message and mail, but may not be the "proper" fix since
> > mutt_parse_adrlist() calls rfc822_parse_adrlist() which has already been
> > called a few lines above this code. Opinions? Any chance of getting
> > this added to the official dist?
>
> Hi Roger,
>
> It looks like your idea is close, but you are right that you don't want
> to add another parse_adrlist call after the previous one.
>
> If you take a look at mutt_parse_adrlist(), you'll see that it actually
> calls the rfc822_parse_adrlist for you, but tokenizes whitespace if it
> find any. It looks like the mutt_parse_adrlist() is simply a drop-in
> replacement for rfc822_parse_adrlist! I would try simply swapping the
> call to rfc822_parse_adrlist and see if that works:
>
> if (rc || !buf[0])
> return;
>
> - if (!(adr = rfc822_parse_adrlist (adr, buf)))
> + if (!(adr = mutt_parse_adrlist (adr, buf)))
> {
> mutt_error _("Error parsing address!");
> return;
> }
>
> adr = mutt_expand_aliases (adr);
>
> If it does, please feel free to post another patch to the list.
>
> -Kevin
That seems to work fine, and since mutt_parse_adrlist() calls
rfc822_parse_adrlist() and returns its result, error handling should be
unaffected. Below is an updated patch.
Roger
diff -ru Orig/mutt-1.5.23/commands.c mutt-1.5.23/commands.c
--- Orig/mutt-1.5.23/commands.c 2014-03-12 12:03:45.000000000 -0400
+++ mutt-1.5.23/commands.c 2014-06-23 17:18:38.070541022 -0400
@@ -286,7 +286,7 @@
if (rc || !buf[0])
return;
- if (!(adr = rfc822_parse_adrlist (adr, buf)))
+ if (!(adr = mutt_parse_adrlist (adr, buf)))
{
mutt_error _("Error parsing address!");
return;