summaryrefslogtreecommitdiffstats
path: root/mh.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-07-28 19:07:06 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-07-28 19:07:06 +0000
commite504b5f8753ccec72a9a776834f5354911a7a29a (patch)
treef10d273e0fa9b6c044d6afc919fb27984b23c242 /mh.c
parentd521c03a25a159e5316edf9ed5bf1918b61a0815 (diff)
Re-parse mh messages when committing them to disk. The structure
may have changed.
Diffstat (limited to 'mh.c')
-rw-r--r--mh.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mh.c b/mh.c
index 5281247b..13fcd7aa 100644
--- a/mh.c
+++ b/mh.c
@@ -606,6 +606,8 @@ static int mh_sync_message (CONTEXT *ctx, int msgno)
char newpath[_POSIX_PATH_MAX];
char partpath[_POSIX_PATH_MAX];
+ FILE *f;
+
if ((dest = mx_open_new_message (ctx, h, 0)) == NULL)
return -1;
@@ -651,10 +653,16 @@ static int mh_sync_message (CONTEXT *ctx, int msgno)
/*
* The message structure and offsets may have changed, so free it
- * here. The message will be reparsed later.
+ * here.
*/
- mutt_free_body (&h->content->parts);
+ mutt_free_body (&h->content);
+ if ((f = fopen (oldpath, "r")))
+ {
+ mutt_free_envelope (&h->env);
+ h->env = mutt_read_rfc822_header (f, h, 0);
+ fclose (f);
+ }
return rc;
}