From e9860dc1f8a5ebb485b337250e5f61fa9064c859 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Sun, 15 Aug 1999 11:33:27 +0000 Subject: Remove ugly mh-synching kludge. --- copy.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'copy.c') diff --git a/copy.c b/copy.c index 4400378f..fe6b35aa 100644 --- a/copy.c +++ b/copy.c @@ -417,6 +417,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, { char prefix[SHORT_STRING]; STATE s; + long new_offset = -1; if (flags & M_CM_PREFIX) _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, hdr, 0); @@ -429,7 +430,6 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, else if (hdr->attach_del && (chflags & CH_UPDATE_LEN)) { int new_lines; - long new_offset; long new_length = body->length; char date[SHORT_STRING]; @@ -488,6 +488,8 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, if (mutt_copy_header (fpin, hdr, fpout, chflags, (chflags & CH_PREFIX) ? prefix : NULL) == -1) return -1; + + new_offset = ftell (fpout); } if (flags & M_CM_DECODE) @@ -555,9 +557,17 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, } } } - else - return mutt_copy_bytes (fpin, fpout, body->length); + else if (mutt_copy_bytes (fpin, fpout, body->length) == -1) + return -1; + } + + if ((flags & M_CM_UPDATE) && (flags & M_CM_NOHEADER) == 0 + && new_offset != -1) + { + body->offset = new_offset; + mutt_free_body (&body->parts); } + return 0; } -- cgit v1.2.3