X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=copy.c;h=6df40039c6b3dd34b6399c2c82986ce60c816bd4;hp=d658ffc96cd02618509779ca773ff6e24c55c543;hb=c0d71a35d690605434605578a0d34ce101f754bb;hpb=23e6291cb5d5b4cd2008403d8b628007fd75ff23 diff --git a/copy.c b/copy.c index d658ffc..6df4003 100644 --- a/copy.c +++ b/copy.c @@ -7,20 +7,7 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include #include @@ -29,6 +16,7 @@ #include "mx.h" #include "copy.h" #include +#include #include "mutt_idna.h" static int address_header_decode (char **str); @@ -138,9 +126,9 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, if (nl && buf[0] != ' ' && buf[0] != '\t') { /* set curline to 1 for To:/Cc:/Bcc: and 0 otherwise */ - curline = (flags & CH_WEED) && (ascii_strncmp ("To:", buf, 3) == 0 || - ascii_strncmp ("Cc:", buf, 3) == 0 || - ascii_strncmp ("Bcc:", buf, 4) == 0); + curline = (flags & CH_WEED) && (m_strncmp("To:", buf, 3) == 0 || + m_strncmp("Cc:", buf, 3) == 0 || + m_strncmp("Bcc:", buf, 4) == 0); /* Do we have anything pending? */ if (this_one) { @@ -346,8 +334,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, fputs ("MIME-Version: 1.0\n", out); fputs ("Content-Transfer-Encoding: 8bit\n", out); fputs ("Content-Type: text/plain; charset=", out); - mutt_canonical_charset (chsbuf, sizeof (chsbuf), - Charset ? Charset : "us-ascii"); + charset_canonicalize(chsbuf, sizeof (chsbuf), Charset); rfc822_strcpy(buffer, sizeof(buffer), chsbuf, MimeSpecials); fputs (buffer, out); fputc ('\n', out); @@ -571,7 +558,7 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body, Context->vsize -= body->length - new_length; body->length = new_length; - mutt_free_body (&body->parts); + body_list_wipe(&body->parts); } return 0; @@ -630,10 +617,10 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body, fseeko (fp, cur->offset, 0); if (mutt_copy_bytes (fp, fpout, cur->length) == -1) { fclose (fp); - mutt_free_body (&cur); + body_list_wipe(&cur); return (-1); } - mutt_free_body (&cur); + body_list_wipe(&cur); fclose (fp); } else { @@ -658,7 +645,7 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body, if ((flags & M_CM_UPDATE) && (flags & M_CM_NOHEADER) == 0 && new_offset != -1) { body->offset = new_offset; - mutt_free_body (&body->parts); + body_list_wipe(&body->parts); } return rc;