summaryrefslogtreecommitdiffstats
path: root/compose.c
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2005-08-02 14:39:56 +0000
committerBrendan Cully <brendan@kublai.com>2005-08-02 14:39:56 +0000
commit67daba7815137339bfb95c65db3a189f7193d4d5 (patch)
treec043bcf31283037f8fc016caf74fb73c4a09a9d1 /compose.c
parenta9fb8d9f35df615b22b0119799bb8ce4c685ffcd (diff)
In compose menu, detach should be able to unlink files generated by mutt,
but not files that existed before.
Diffstat (limited to 'compose.c')
-rw-r--r--compose.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/compose.c b/compose.c
index eab1b26b..8f216d4f 100644
--- a/compose.c
+++ b/compose.c
@@ -686,6 +686,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
{
char *att = files[i];
idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen]->unowned = 1;
idx[idxlen]->content = mutt_make_file_attach (att);
if (idx[idxlen]->content != NULL)
update_idx (menu, idx, idxlen++);
@@ -814,7 +815,8 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
case OP_DELETE:
CHECK_COUNT;
- idx[menu->current]->content->unlink = 0;
+ if (idx[menu->current]->unowned)
+ idx[menu->current]->content->unlink = 0;
if (delete_attachment (menu, &idxlen, menu->current) == -1)
break;
mutt_update_tree (idx, idxlen);