diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-08-15 11:33:27 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-08-15 11:33:27 +0000 |
commit | e9860dc1f8a5ebb485b337250e5f61fa9064c859 (patch) | |
tree | 09b5d25c29eb6af67b55151a2a514c55f1434ba9 /copy.c | |
parent | 9b5c3c3c423d10ae9775a39626b39ccefd2d6b35 (diff) |
Remove ugly mh-synching kludge.
Diffstat (limited to 'copy.c')
-rw-r--r-- | copy.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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; } |