add m_strchrnul that does what GNU strchrnul does: search for 'c' or
[apps/madmutt.git] / copy.c
diff --git a/copy.c b/copy.c
index 504a1e2..2c653e1 100644 (file)
--- a/copy.c
+++ b/copy.c
 # 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/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include "handler.h"
 #include "mx.h"
 #include "copy.h"
-#include "mutt_crypt.h"
+#include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <unistd.h>             /* needed for SEEK_SET under SunOS 4.1.4 */
-
 static int address_header_decode (char **str);
 static int copy_delete_attach (BODY * b, FILE * fpin, FILE * fpout,
                                char *date);
@@ -621,26 +620,23 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body,
     if (flags & M_CM_REPLYING)
       s.flags |= M_REPLYING;
 
-    if (WithCrypto && flags & M_CM_VERIFY)
+    if (flags & M_CM_VERIFY)
       s.flags |= M_VERIFY;
 
     rc = mutt_body_handler (body, &s);
   }
-  else if (WithCrypto
-           && (flags & M_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT)) {
+  else if ((flags & M_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT)) {
     BODY *cur;
     FILE *fp;
 
-    if ((WithCrypto & APPLICATION_PGP)
-        && (flags & M_CM_DECODE_PGP) && (hdr->security & APPLICATION_PGP) &&
+    if ((flags & M_CM_DECODE_PGP) && (hdr->security & APPLICATION_PGP) &&
         hdr->content->type == TYPEMULTIPART) {
       if (crypt_pgp_decrypt_mime (fpin, &fp, hdr->content, &cur))
         return (-1);
       fputs ("MIME-Version: 1.0\n", fpout);
     }
 
-    if ((WithCrypto & APPLICATION_SMIME)
-        && (flags & M_CM_DECODE_SMIME) && (hdr->security & APPLICATION_SMIME)
+    if ((flags & M_CM_DECODE_SMIME) && (hdr->security & APPLICATION_SMIME)
         && hdr->content->type == TYPEAPPLICATION) {
       if (crypt_smime_decrypt_mime (fpin, &fp, hdr->content, &cur))
         return (-1);