summaryrefslogtreecommitdiffstats
path: root/attach.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-02-17 18:00:38 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-02-17 18:00:38 +0000
commit41ac4a02bd17781e738a97f1ab6fedeadc7015c8 (patch)
treeb1ea8d1a66dada8910bb43365fc455e5e35de1bc /attach.c
parentf99db0af0db47e908261b00107eb8f1e86fb7aa4 (diff)
Do more error checking when writing messages to folders.
Diffstat (limited to 'attach.c')
-rw-r--r--attach.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/attach.c b/attach.c
index 8b2d668f..fb1ecee1 100644
--- a/attach.c
+++ b/attach.c
@@ -702,10 +702,12 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr)
if (ctx.magic == M_MBOX || ctx.magic == M_MMDF || ctx.magic == M_KENDRA)
chflags = CH_FROM;
chflags |= (ctx.magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
- if ((r = _mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags)) == 0)
+ if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0
+ && mx_commit_message (msg, &ctx) == 0)
mutt_message _("Attachment saved.");
+ else
+ r = -1;
- mx_commit_message (msg, &ctx);
mx_close_message (&msg);
mx_close_mailbox (&ctx);
return r;