changeset: 7129:1306ee5f4bf7
user: Kevin McCarthy <[email protected]>
date: Fri Aug 11 09:04:48 2017 -0700
link: http://dev.mutt.org/hg/mutt/rev/1306ee5f4bf7
Fix parent_hdr usage in mutt_attach_reply(). (see #3728)
If the selected attachments are not messages and no (common) parent is
found, parent_hdr is set to the passed in hdr. In that case, parent
will still be NULL, but parent_hdr and parent_fp will be set.
Change the test to parent_hdr being NULL, not parent, to check for
this case.
diffs (30 lines):
diff -r 052ad4fcdd6b -r 1306ee5f4bf7 recvcmd.c
--- a/recvcmd.c Thu Aug 10 18:18:28 2017 -0700
+++ b/recvcmd.c Fri Aug 11 09:04:48 2017 -0700
@@ -874,7 +874,7 @@
tmphdr->env = mutt_new_envelope ();
if (attach_reply_envelope_defaults (tmphdr->env, actx,
- parent ? parent_hdr : (cur ? cur->hdr :
NULL), flags) == -1)
+ parent_hdr ? parent_hdr : (cur ? cur->hdr
: NULL), flags) == -1)
{
mutt_free_header (&tmphdr);
return;
@@ -888,7 +888,7 @@
return;
}
- if (!parent)
+ if (!parent_hdr)
{
if (cur)
attach_include_reply (fp, tmpfp, cur->hdr, flags);
@@ -961,7 +961,7 @@
safe_fclose (&tmpfp);
if (ci_send_message (flags, tmphdr, tmpbody, NULL,
- parent ? parent_hdr : (cur ? cur->hdr : NULL)) == 0)
+ parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) ==
0)
mutt_set_flag (Context, hdr, MUTT_REPLIED, 1);
}