mappings as standalone module
[apps/madmutt.git] / recvattach.c
index 157e93e..1121d2d 100644 (file)
@@ -17,6 +17,7 @@
 #include <lib-lib/macros.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/file.h>
+#include <lib-lib/mapping.h>
 
 #include "mutt.h"
 #include "enter.h"
@@ -27,7 +28,6 @@
 #include "rfc1524.h"
 #include "mime.h"
 #include "attach.h"
-#include "mapping.h"
 #include "mx.h"
 #include "copy.h"
 #include "mutt_crypt.h"
@@ -262,7 +262,7 @@ const char *mutt_attach_fmt (char *dest,
       if (aptr->content->filename && *aptr->content->filename == '/') {
         char path[_POSIX_PATH_MAX];
 
-        strfcpy (path, aptr->content->filename, sizeof (path));
+        m_strcpy(path, sizeof(path), aptr->content->filename);
         mutt_pretty_mailbox (path);
         mutt_format_s (dest, destlen, prefix, path);
       }
@@ -412,7 +412,7 @@ static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
       mutt_concat_path(buf, sizeof(buf), *directory,
                        mutt_basename(body->filename));
     else
-      strfcpy (buf, body->filename, sizeof (buf));
+      m_strcpy(buf, sizeof(buf), body->filename);
   }
   else if (body->hdr &&
            body->encoding != ENCBASE64 &&
@@ -434,7 +434,7 @@ static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
       char tmpbuf[_POSIX_PATH_MAX];
 
       snprintf (tmpbuf, sizeof (tmpbuf), "%s%s", LastSaveFolder, buf);
-      strfcpy (buf, tmpbuf, sizeof (buf));
+      m_strcpy(buf, sizeof(buf), tmpbuf);
       ret = mutt_get_field (_("Save to file: ")
                             , buf, sizeof (buf), M_FILE);
       if ((ret != 0) || (!buf[0]))
@@ -442,7 +442,7 @@ static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
     }
     else {
       mutt_extract_path (buf, path);
-      strfcpy (LastSaveFolder, path, sizeof (LastSaveFolder));
+      m_strcpy(LastSaveFolder, sizeof(LastSaveFolder), path);
     }
 
     prompt = NULL;
@@ -464,7 +464,7 @@ static int mutt_query_save_attachment (FILE * fp, BODY * body, HEADER * hdr,
       }
       else if (rc == -1)
         return -1;
-      strfcpy (tfile, buf, sizeof (tfile));
+      m_strcpy(tfile, sizeof(tfile), buf);
     }
     else {
       if ((rc =
@@ -511,7 +511,7 @@ void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr,
         if (!buf[0]) {
           int append = 0;
 
-          strfcpy (buf, NONULL (top->filename), sizeof (buf));
+          m_strcpy(buf, sizeof(buf), NONULL(top->filename));
           if (mutt_get_field (_("Save to file: "), buf, sizeof (buf),
                               M_FILE | M_CLEAR) != 0 || !buf[0])
             return;