X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=compose.c;h=aacfd8d69e7ff1341174455dbddd44a359661ece;hb=bad8211c28d4b229878e0264012009493db48da5;hp=377d60e8ae1a0b18da14468fa657dacb65f9c5b2;hpb=96d53ff49c308769efbf708e1e65819077cb7af6;p=apps%2Fmadmutt.git diff --git a/compose.c b/compose.c index 377d60e..aacfd8d 100644 --- a/compose.c +++ b/compose.c @@ -801,6 +801,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++); @@ -954,6 +955,8 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ case OP_DELETE: CHECK_COUNT; + 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); @@ -1278,6 +1281,8 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ /* avoid freeing other attachments */ idx[idxlen]->content->next = NULL; idx[idxlen]->content->parts = NULL; + if (idx[idxlen]->unowned) + idx[idxlen]->content->unlink = 0; mutt_free_body (&idx[idxlen]->content); FREE (&idx[idxlen]->tree); FREE (&idx[idxlen]);