]> diplodocus.org Git - nmh/blobdiff - uip/mhlist.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / uip / mhlist.c
index 11dd59f255e266e9a1f299c4b7ea100fe456a536..93e2ea0ee75d8a9d1de3264321c6ee5251604cfb 100644 (file)
@@ -16,7 +16,7 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include "mhmisc.h"
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 #include "mhmisc.h"
-#include "../sbr/m_maildir.h"
+#include "sbr/m_maildir.h"
 #include "mhfree.h"
 
 #define MHLIST_SWITCHES \
 #include "mhfree.h"
 
 #define MHLIST_SWITCHES \
@@ -34,6 +34,7 @@
     X("part number", 0, PARTSW) \
     X("type content", 0, TYPESW) \
     X("prefer content", 0, PREFERSW) \
     X("part number", 0, PARTSW) \
     X("type content", 0, TYPESW) \
     X("prefer content", 0, PREFERSW) \
+    X("noprefer", 0, NPREFERSW) \
     X("rcache policy", 0, RCACHESW) \
     X("wcache policy", 0, WCACHESW) \
     X("changecur", 0, CHGSW) \
     X("rcache policy", 0, RCACHESW) \
     X("wcache policy", 0, WCACHESW) \
     X("changecur", 0, CHGSW) \
@@ -50,11 +51,6 @@ DEFINE_SWITCH_ENUM(MHLIST);
 DEFINE_SWITCH_ARRAY(MHLIST, switches);
 #undef X
 
 DEFINE_SWITCH_ARRAY(MHLIST, switches);
 #undef X
 
-/* mhparse.c */
-extern char *preferred_types[];
-extern  char *preferred_subtypes[];
-extern int npreferred;
-
 /*
  * This is currently needed to keep mhparse happy.
  * This needs to be changed.
 /*
  * This is currently needed to keep mhparse happy.
  * This needs to be changed.
@@ -63,9 +59,6 @@ int debugsw = 0;
 
 #define        quitser pipeser
 
 
 #define        quitser pipeser
 
-/* mhparse.c */
-CT parse_mime (char *);
-
 /*
  * static prototypes
  */
 /*
  * static prototypes
  */
@@ -176,10 +169,14 @@ do_cache:
                if (npreferred >= NPREFS)
                    adios (NULL, "too many preferred types (starting with %s), %d max",
                           cp, NPREFS);
                if (npreferred >= NPREFS)
                    adios (NULL, "too many preferred types (starting with %s), %d max",
                           cp, NPREFS);
-               preferred_types[npreferred] = cp;
+                mime_preference[npreferred].type = cp;
                cp = strchr(cp, '/');
                if (cp) *cp++ = '\0';
                cp = strchr(cp, '/');
                if (cp) *cp++ = '\0';
-               preferred_subtypes[npreferred++] = cp;
+               mime_preference[npreferred++].subtype = cp;
+               continue;
+
+           case NPREFERSW:
+               npreferred = 0;
                continue;
 
            case FILESW:
                continue;
 
            case FILESW: