]> diplodocus.org Git - nmh/blobdiff - uip/mhfixmsg.c
Make sure to mark the sequence file as closed in the msgs struct.
[nmh] / uip / mhfixmsg.c
index 1f240e4568a9729e9f4c69570f8d25f489d9eccd..150600a891f2dff90a90bbf38826f5b5ddcb7fb4 100644 (file)
@@ -31,6 +31,8 @@
     X("nofixcte", 0, NFIXCTESW) \
     X("file file", 0, FILESW) \
     X("outfile file", 0, OUTFILESW) \
+    X("rmmproc program", 0, RPROCSW) \
+    X("normmproc", 0, NRPRCSW) \
     X("verbose", 0, VERBSW) \
     X("noverbose", 0, NVERBSW) \
     X("version", 0, VERSIONSW) \
@@ -216,6 +218,14 @@ main (int argc, char **argv) {
                 outfile = *cp == '-'  ?  add (cp, NULL)  :  path (cp, TFILE);
                 continue;
 
+            case RPROCSW:
+                if (!(rmmproc = *argp++) || *rmmproc == '-')
+                    adios (NULL, "missing argument to %s", argp[-2]);
+                continue;
+            case NRPRCSW:
+                rmmproc = NULL;
+                continue;
+
             case VERBSW:
                 verbosw = 1;
                 continue;
@@ -315,7 +325,7 @@ main (int argc, char **argv) {
             adios (maildir, "unable to change directory to");
 
         /* read folder and create message structure */
-        if (! (mp = folder_read (folder)))
+        if (! (mp = folder_read (folder, 1)))
             adios (NULL, "unable to read folder %s", folder);
 
         /* check for empty folder */
@@ -1815,13 +1825,10 @@ static int
 remove_file (char *file) {
     if (rmmproc) {
         char *rmm_command = concat (rmmproc, " ", file, NULL);
-        int status = WIFEXITED (status = system (rmm_command))
-            ?  WEXITSTATUS (status)
-            :  NOTOK;
+        int status = system (rmm_command);
 
         free (rmm_command);
-
-        return status;
+        return WIFEXITED (status)  ?  WEXITSTATUS (status)  :  NOTOK;
     } else {
         /* This is OK for a non-message file, it still uses the
            BACKUP_PREFIX form.  The backup file will be in the same