X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=copy.c;h=d386400d56e0c3007b537e9d92bc12e6ef6f5204;hp=661b3894a6e6c5190db62c9a2c4c366b90cb7073;hb=916e4872caf252a5850e64f79427b9dd7808435d;hpb=10b7c16c8905d1b7ceaeeb6cfab9ad2ec03d8780 diff --git a/copy.c b/copy.c index 661b389..d386400 100644 --- a/copy.c +++ b/copy.c @@ -7,28 +7,16 @@ * 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 +#include #include "mutt.h" #include "handler.h" -#include "mx.h" #include "copy.h" #include +#include #include "mutt_idna.h" static int address_header_decode (char **str); @@ -45,7 +33,7 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, int this_is_from; int ignore = 0; char buf[STRING]; /* should be long enough to get most fields in one pass */ - char *nl; + char *eol; string_list_t *t; char **headers; int hdr_count; @@ -67,13 +55,13 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, * we can do a more efficient line to line copying */ while (ftello (in) < off_end) { - nl = strchr (buf, '\n'); + eol = strchr (buf, '\n'); if ((fgets (buf, sizeof (buf), in)) == NULL) break; /* Is it the begining of a header? */ - if (nl && buf[0] != ' ' && buf[0] != '\t') { + if (eol && buf[0] != ' ' && buf[0] != '\t') { ignore = 1; if (!from && m_strncmp("From ", buf, 5) == 0) { if ((flags & CH_FROM) == 0) @@ -128,19 +116,19 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, /* Read all the headers into the array */ while (ftello (in) < off_end) { - nl = strchr (buf, '\n'); + eol = strchr (buf, '\n'); /* Read a line */ if ((fgets (buf, sizeof (buf), in)) == NULL) break; /* Is it the begining of a header? */ - if (nl && buf[0] != ' ' && buf[0] != '\t') { + if (eol && 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) { @@ -628,12 +616,12 @@ _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); + m_fclose(&fp); body_list_wipe(&cur); return (-1); } body_list_wipe(&cur); - fclose (fp); + m_fclose(&fp); } else { fseeko (fpin, body->offset, 0);