Move (un)?lists and (un)subscribe to MAlias.
[apps/madmutt.git] / lib-mime / rfc1524.c
index 6c4f2e5..fdbf182 100644 (file)
  * rfc1524.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 
@@ -318,7 +301,7 @@ rfc1524_mailcap_parse(BODY *a, const char *filename, const char *type,
                     ssize_t len   = m_strlen(value) + STRING;
                     char *testcmd = p_new(char, len);
 
-                    strcpy(testcmd, value);
+                    m_strcpy(testcmd, len, value);
                     rfc1524_expand_command(a, a->filename, type, testcmd, len);
                     found = !mutt_system(testcmd);
                     p_delete(&testcmd);
@@ -355,7 +338,7 @@ rfc1524_mailcap_parse(BODY *a, const char *filename, const char *type,
             rfc1524_entry_init(entry);
         }
     }                           /* while (!found && (buf = mutt_read_line ())) */
-    fclose (fp);
+    m_fclose(&fp);
 
   error:
     p_delete(&buf);
@@ -391,7 +374,7 @@ int rfc1524_mailcap_lookup (BODY * a, char *type, rfc1524_entry * entry,
     return 0;
   }
 
-  mutt_check_lookup_list (a, type, SHORT_STRING);
+  mutt_check_lookup_list (a, type, STRING);
 
   while (!found && *curr) {
     x = 0;
@@ -406,7 +389,7 @@ int rfc1524_mailcap_lookup (BODY * a, char *type, rfc1524_entry * entry,
       continue;
 
     path[x] = '\0';
-    mutt_expand_path (path, sizeof (path));
+    mutt_expand_path(path, sizeof(path));
 
     found = rfc1524_mailcap_parse (a, path, type, entry, opt);
   }
@@ -454,9 +437,8 @@ int rfc1524_expand_filename (char *nametemplate,
       m_strcpy(newfile, nflen, oldfile);
   }
   else if (!oldfile) {
-    mutt_expand_fmt (newfile, nflen, nametemplate, "mutt");
-  }
-  else {                        /* oldfile && nametemplate */
+    m_file_fmt(newfile, nflen, nametemplate, "mutt");
+  } else {                        /* oldfile && nametemplate */
 
 
     /* first, compare everything left from the "%s"