summaryrefslogtreecommitdiffstats
path: root/editmsg.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-05-08 12:10:51 -0700
committerKevin McCarthy <kevin@8t8.us>2020-05-08 12:10:51 -0700
commit094a07fc9dde6cd795a4bf7878d1d51a7a38a94a (patch)
tree649e2fb9dbd08418ad6f96b6e171597491b96ea4 /editmsg.c
parent51ed59a7177c943a66b6695941610b9c4ac4a7bf (diff)
Fix rc error setting in edit_one_message().
In a couple places, the rc was not set before bailing on an error. With a default of 0, the original message would be marked for delete/purge.
Diffstat (limited to 'editmsg.c')
-rw-r--r--editmsg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/editmsg.c b/editmsg.c
index 75a50c8f..d51011d8 100644
--- a/editmsg.c
+++ b/editmsg.c
@@ -110,6 +110,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
if (sb.st_size != 0 &&
truncate (mutt_b2s (tmp), sb.st_size - 1) == -1)
{
+ rc = -1;
mutt_error (_("could not truncate temporary mail folder: %s"),
strerror (errno));
goto bail;
@@ -178,6 +179,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
if (msg == NULL)
{
+ rc = -1;
mutt_error (_("Can't append to folder: %s"), strerror (errno));
mx_close_mailbox (&tmpctx, NULL);
goto bail;