summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-08-16 18:31:11 -0700
committerKevin McCarthy <kevin@8t8.us>2021-08-16 18:31:11 -0700
commiteda54c6bb6b15939c2cc26f451166cccd9a138eb (patch)
tree2e0924243b0e51f4f3fc0e43bc14c4cdeb5955af
parent6c0f75cca9f962524e9a7c1482ab342acf1ce5c1 (diff)
Improve attach files handling of empty value.
Hitting enter at the attach files prompt will still allocate an entry in the attachment array. It might make sense to "abort" inside the prompt for that case, but it's a change of behavior to have the prompt do so. Instead, have the compose menu prompt skip NULL values.
-rw-r--r--compose.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compose.c b/compose.c
index c0adc976..7fd8b662 100644
--- a/compose.c
+++ b/compose.c
@@ -1261,6 +1261,8 @@ int mutt_compose_menu (SEND_CONTEXT *sctx)
for (i = 0; i < numfiles; i++)
{
char *att = files[i];
+ if (!att)
+ continue;
new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
new->unowned = 1;
new->content = mutt_make_file_attach (att);