summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-12-03 13:47:50 -0800
committerKevin McCarthy <kevin@8t8.us>2020-12-03 13:47:50 -0800
commit9518a0ab45e4f605361b94a5bc93f7a5426f596e (patch)
tree6114057576f67f9145d9944bb59d3bc563d8c1db /commands.c
parent8d1f22a1f47a00f5f75c3878342c3a65ebcfd18a (diff)
Add a mutt_error() when copy/save messages fails.
Avoid using "part" translations for the tag/untagged copy/save combinations, even though that makes the code longer.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/commands.c b/commands.c
index 70419dad..e8a34fa6 100644
--- a/commands.c
+++ b/commands.c
@@ -976,7 +976,7 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
break;
/* fatal error, abort */
case -1:
- goto cleanup;
+ goto errcleanup;
}
}
#endif
@@ -994,7 +994,7 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
if (_mutt_save_message(h, &ctx, delete, decode, decrypt) != 0)
{
mx_close_mailbox (&ctx, NULL);
- goto cleanup;
+ goto errcleanup;
}
}
else
@@ -1020,7 +1020,7 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
&ctx, delete, decode, decrypt) != 0)
{
mx_close_mailbox (&ctx, NULL);
- goto cleanup;
+ goto errcleanup;
}
}
}
@@ -1037,6 +1037,37 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
rc = 0;
}
+errcleanup:
+ if (rc != 0)
+ {
+ if (delete)
+ {
+ if (h)
+ /* L10N:
+ Message when an index/pager save operation fails for some reason.
+ */
+ mutt_error _("Error saving message");
+ else
+ /* L10N:
+ Message when an index tagged save operation fails for some reason.
+ */
+ mutt_error _("Error saving tagged messages");
+ }
+ else
+ {
+ if (h)
+ /* L10N:
+ Message when an index/pager copy operation fails for some reason.
+ */
+ mutt_error _("Error copying message");
+ else
+ /* L10N:
+ Message when an index tagged copy operation fails for some reason.
+ */
+ mutt_error _("Error copying tagged messages");
+ }
+ }
+
cleanup:
mutt_buffer_pool_release (&buf);
return rc;