]> diplodocus.org Git - nmh/blobdiff - uip/mhshow.c
inc/test-eom-align: Create test mboxes in less steps.
[nmh] / uip / mhshow.c
index 8c604ad8689dc774903e821fe7a6f9bd8fe1e262..d3b8504e39d2ee07ac33387146d250736a95067c 100644 (file)
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
+#include "h/done.h"
 #include <h/utils.h>
 #include "mhmisc.h"
-#include "../sbr/m_maildir.h"
-#include "../sbr/m_popen.h"
+#include "sbr/m_maildir.h"
+#include "sbr/m_popen.h"
 #include "mhfree.h"
 #include "mhshowsbr.h"
 
@@ -42,6 +43,7 @@
     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("version", 0, VERSIONSW) \
@@ -92,7 +94,7 @@ main (int argc, char **argv)
 
     if (nmh_init(argv[0], 1)) { return 1; }
 
-    done=freects_done;
+    set_done(freects_done);
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
@@ -187,10 +189,14 @@ do_cache:
                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';
-               preferred_subtypes[npreferred++] = cp;
+               mime_preference[npreferred++].subtype = cp;
+               continue;
+
+           case NPREFERSW:
+               npreferred = 0;
                continue;
 
            case FILESW:
@@ -202,7 +208,7 @@ do_cache:
            case FORMSW:
                if (!(cp = *argp++) || *cp == '-')
                    adios (NULL, "missing argument to %s", argp[-2]);
-                mh_xfree(formsw);
+                free(formsw);
                formsw = getcpy (etcpath (cp));
                continue;