]> granicus.if.org Git - neomutt/commitdiff
Fix send-mode printing when expand_filename() returns 1
authorKevin McCarthy <kevin@8t8.us>
Sat, 22 Jun 2019 17:09:02 +0000 (10:09 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 24 Jun 2019 15:20:39 +0000 (16:20 +0100)
It will return this when a nametemplate entry already matched the
passed in filename.  So this bug required both a print entry and an
already matching nametemplate entry to trigger.

Co-authored-by: Richard Russon <rich@flatcap.org>
mutt_attach.c

index b26eb80897c110bf52c94a96cd5dac7d29166258..c983b084fe21be59fc250e9aacb7606195850c20 100644 (file)
@@ -1071,6 +1071,8 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
           unlink_newfile = true;
       }
     }
+    else if (!fp) /* send case */
+      mutt_buffer_strcpy(newfile, a->filename);
 
     /* in recv mode, save file to newfile first */
     if (fp && (mutt_save_attachment(fp, a, mutt_b2s(newfile), MUTT_SAVE_NO_FLAGS, NULL) != 0))