Revert "we use glibc, and gconv. Don't need our own transcoding stuff, glibc does"
[apps/madmutt.git] / copy.c
diff --git a/copy.c b/copy.c
index 8e8f96f..a52a4eb 100644 (file)
--- a/copy.c
+++ b/copy.c
 #include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
+#include <lib-ui/lib-ui.h>
 #include <lib-mx/mx.h>
 
 #include "mutt.h"
 #include "handler.h"
 #include "copy.h"
-#include <lib-crypt/crypt.h>
-#include <lib-ui/curses.h>
+#include "crypt.h"
 #include "mutt_idna.h"
 
 static int address_header_decode (char **str);
@@ -361,7 +361,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), MCharset.charset);
+    charset_canonicalize(chsbuf, sizeof (chsbuf), mod_cset.charset);
     rfc822_strcpy(buffer, sizeof(buffer), chsbuf, MimeSpecials);
     fputs (buffer, out);
     fputc ('\n', out);
@@ -451,7 +451,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags,
   }
 
   if (flags & CH_UPDATE_LEN && (flags & CH_NOLEN) == 0) {
-    fprintf (out, "Content-Length: %lld\n", h->content->length);
+    fprintf (out, "Content-Length: %zu\n", h->content->length);
     if (h->lines != 0 || h->content->length == 0)
       fprintf (out, "Lines: %d\n", h->lines);
   }
@@ -555,7 +555,7 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body,
       if (mutt_copy_header (fpin, hdr, fpout,
                             chflags | CH_NOLEN | CH_NONEWLINE, NULL))
         return -1;
-      fprintf (fpout, "Content-Length: %lld\n", new_length);
+      fprintf (fpout, "Content-Length: %zu\n", new_length);
       if (new_lines <= 0)
         new_lines = 0;
       else
@@ -720,7 +720,7 @@ _mutt_append_message (CONTEXT * dest, FILE * fpin, CONTEXT * src __attribute__ (
     return (-1);
   if ((msg = mx_open_new_message (dest, hdr, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL)
     return (-1);
-  if (dest->magic == M_MBOX || dest->magic == M_MMDF)
+  if (dest->magic == M_MBOX)
     chflags |= CH_FROM | CH_FORCE_FROM;
   chflags |= (dest->magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
   r = _mutt_copy_message (msg->fp, fpin, hdr, body, flags, chflags);
@@ -768,7 +768,7 @@ static int copy_delete_attach (BODY * b, FILE * fpin, FILE * fpout,
       if (part->deleted) {
         fprintf (fpout,
                  "Content-Type: message/external-body; access-type=x-mutt-deleted;\n"
-                 "\texpiration=%s; length=%lld\n"
+                 "\texpiration=%s; length=%zu\n"
                  "\n", date + 5, part->length);
         if (ferror (fpout))
           return -1;