Skip to content

Commit bb88c6f

Browse files
kevin8t8flatcap
authored andcommitted
Fix parent_hdr usage in mutt_attach_reply(). (see neomutt#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.
1 parent 1143be8 commit bb88c6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

recvcmd.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
840840
tmphdr->env = mutt_new_envelope();
841841

842842
if (attach_reply_envelope_defaults(
843-
tmphdr->env, actx, parent ? parent_hdr : (cur ? cur->hdr : NULL), flags) == -1)
843+
tmphdr->env, actx, parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL), flags) == -1)
844844
{
845845
mutt_free_header(&tmphdr);
846846
return;
@@ -854,7 +854,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
854854
return;
855855
}
856856

857-
if (!parent)
857+
if (!parent_hdr)
858858
{
859859
if (cur)
860860
attach_include_reply(fp, tmpfp, cur->hdr, flags);
@@ -926,6 +926,6 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
926926
safe_fclose(&tmpfp);
927927

928928
if (ci_send_message(flags, tmphdr, tmpbody, NULL,
929-
parent ? parent_hdr : (cur ? cur->hdr : NULL)) == 0)
929+
parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) == 0)
930930
mutt_set_flag(Context, hdr, MUTT_REPLIED, 1);
931931
}

0 commit comments

Comments
 (0)