On 2005-08-02 00:35:17 -0700, Brendan Cully wrote: > How's this? I'd put this information into the BODY structure, to keep it close to "unlink"; see below. On another note, I'm not even convinced that this entire thing is a bug that needs fixing... The more I think about this the more I think the original behavior is the right one, and the patch should be backed out again. In particular if you consider that the attachments in question will also be deleted from the disk when you *cancel* a message. Now, why on earth should mutt treat an attachment differently when the *attachment* is cancelled than when the *message* is cancelled? Regards, -- Thomas Roessler · Personal soap box at <http://log.does-not-exist.org/>. cvs diff: Diffing . Index: compose.c =================================================================== RCS file: /cvs/mutt/mutt/compose.c,v retrieving revision 3.24 diff -u -r3.24 compose.c --- compose.c 2 Aug 2005 14:39:56 -0000 3.24 +++ compose.c 3 Aug 2005 09:22:55 -0000 @@ -686,10 +686,12 @@ { 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) + { + idx[idxlen]->content->unowned = 1; update_idx (menu, idx, idxlen++); + } else { error = 1; @@ -815,7 +817,7 @@ case OP_DELETE: CHECK_COUNT; - if (idx[menu->current]->unowned) + if (idx[menu->current]->content->unowned) idx[menu->current]->content->unlink = 0; if (delete_attachment (menu, &idxlen, menu->current) == -1) break; Index: mutt.h =================================================================== RCS file: /cvs/mutt/mutt/mutt.h,v retrieving revision 3.47 diff -u -r3.47 mutt.h --- mutt.h 2 Aug 2005 16:10:42 -0000 3.47 +++ mutt.h 3 Aug 2005 09:22:55 -0000 @@ -668,6 +668,7 @@ */ unsigned int tagged : 1; unsigned int deleted : 1; /* attachment marked for deletion */ + unsigned int unowned : 1; /* don't unlink on detach */ unsigned int noconv : 1; /* don't do character set conversion */ unsigned int force_charset : 1; @@ -855,7 +856,6 @@ char *tree; int level; int num; - unsigned int unowned : 1; /* don't unlink on detach */ } ATTACHPTR; typedef struct
Attachment:
pgp94rLPtSTaG.pgp
Description: PGP signature