make the dump be an almost valid .rc file.
[apps/madmutt.git] / copy.c
diff --git a/copy.c b/copy.c
index ccbf308..6df4003 100644 (file)
--- 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 <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#include <lib-lib/macros.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
@@ -29,6 +16,7 @@
 #include "mx.h"
 #include "copy.h"
 #include <lib-crypt/crypt.h>
+#include <lib-ui/curses.h>
 #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);
-    charset_canonicalize (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);