diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-02-17 18:00:38 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-02-17 18:00:38 +0000 |
commit | 41ac4a02bd17781e738a97f1ab6fedeadc7015c8 (patch) | |
tree | b1ea8d1a66dada8910bb43365fc455e5e35de1bc /attach.c | |
parent | f99db0af0db47e908261b00107eb8f1e86fb7aa4 (diff) |
Do more error checking when writing messages to folders.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |