X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/63764e68d4fce20854dc2ba18a7244cb6a6769ca..4dff00a2d1a9e0b1e301c3015d8f7bdf87e2e37a:/uip/mhfixmsg.c?ds=sidebyside diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 1f240e45..150600a8 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -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