summaryrefslogtreecommitdiffstats
path: root/editmsg.c
diff options
context:
space:
mode:
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>2005-02-12 19:35:36 +0000
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>2005-02-12 19:35:36 +0000
commit70e34de6ec359d96f39c4be53f05961683f72321 (patch)
tree6d280dcbd5952a74a39e7e2f22b6cc019acd63b7 /editmsg.c
parent36a3a4fdd4738f69a24c093bdcd02e98df578194 (diff)
Partially fix debian bug #275060 (editing a message in a mbox loses
its flags).
Diffstat (limited to 'editmsg.c')
-rw-r--r--editmsg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/editmsg.c b/editmsg.c
index 981899a5..0d037d4f 100644
--- a/editmsg.c
+++ b/editmsg.c
@@ -79,7 +79,9 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
return -1;
}
- rc = mutt_append_message (&tmpctx, ctx, cur, 0, CH_NOLEN | CH_NOSTATUS); oerrno = errno;
+ rc = mutt_append_message (&tmpctx, ctx, cur, 0, CH_NOLEN |
+ ((ctx->magic == M_MBOX || ctx->magic == M_MMDF) ? 0 : CH_NOSTATUS));
+ oerrno = errno;
mx_close_mailbox (&tmpctx, NULL);
@@ -143,7 +145,8 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
goto bail;
}
- of = cf = 0;
+ of = 0;
+ cf = ((tmpctx.magic == M_MBOX || tmpctx.magic == M_MMDF) ? 0 : CH_NOSTATUS);
if (fgets (buff, sizeof (buff), fp) && is_from (buff, NULL, 0, NULL))
{
@@ -171,7 +174,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
goto bail;
}
- if ((rc = mutt_copy_hdr (fp, msg->fp, 0, sb.st_size, CH_NOSTATUS | CH_NOLEN | cf, NULL)) == 0)
+ if ((rc = mutt_copy_hdr (fp, msg->fp, 0, sb.st_size, CH_NOLEN | cf, NULL)) == 0)
{
fputc ('\n', msg->fp);
rc = mutt_copy_stream (fp, msg->fp);