diff options
author | Kevin McCarthy <kevin@8t8.us> | 2019-06-22 12:35:58 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2019-06-22 12:35:58 -0700 |
commit | a99a75b7ab1f52b83a69c40a3ff67833bcbb38ba (patch) | |
tree | e4ce5e1d9e6a53e705bf4c7575d7f0afcf181991 /attach.c | |
parent | 2fd320a877f13c5558fda32eaab5ae6088f0eace (diff) |
Fix compose and edit attachment symlink failure code.
In the case where safe_symlink() fail, mutt prompts to continue, but
did not properly reset the filename to be operated on.
Fix up mutt_view_attachment() to use the same flow as the others, to
allow for easier comparison.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -121,6 +121,7 @@ int mutt_compose_attachment (BODY *a) { if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES) goto bailout; + mutt_buffer_strcpy (newfile, a->filename); } else unlink_newfile = 1; @@ -256,6 +257,7 @@ int mutt_edit_attachment (BODY *a) { if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES) goto bailout; + mutt_buffer_strcpy (newfile, a->filename); } else unlink_newfile = 1; @@ -418,10 +420,9 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, /* send case: the file is already there */ if (safe_symlink (a->filename, mutt_b2s (tempfile)) == -1) { - if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) == MUTT_YES) - mutt_buffer_strcpy (tempfile, a->filename); - else + if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES) goto return_error; + mutt_buffer_strcpy (tempfile, a->filename); } else unlink_tempfile = 1; |