]> diplodocus.org Git - nmh/blobdiff - uip/refile.c
Support for sequence file locking in inc(1).
[nmh] / uip / refile.c
index ae71de23e12eb1ffc48527289ffe239b4c76c190..8dd04fb92a46355de6c6ae280f243f9d03eaf31f 100644 (file)
@@ -195,7 +195,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read source folder and create message structure */
        adios (maildir, "unable to change directory to");
 
     /* read source 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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -282,7 +282,7 @@ opnfolds (struct st_fold *folders, int nfolders)
 
        if (chdir (nmaildir) == NOTOK)
            adios (nmaildir, "unable to change directory to");
 
        if (chdir (nmaildir) == NOTOK)
            adios (nmaildir, "unable to change directory to");
-       if (!(mp = folder_read (fp->f_name)))
+       if (!(mp = folder_read (fp->f_name, 1)))
            adios (NULL, "unable to read folder %s", fp->f_name);
        mp->curmsg = 0;
 
            adios (NULL, "unable to read folder %s", fp->f_name);
        mp->curmsg = 0;
 
@@ -321,17 +321,19 @@ clsfolds (struct st_fold *folders, int nfolders)
 static void
 remove_files (int filep, char **files)
 {
 static void
 remove_files (int filep, char **files)
 {
-    int i;
-    char **vec;
+    int i, vecp;
+    char **vec, *program;
 
     /* If rmmproc is defined, we use that */
     if (rmmproc) {
 
     /* If rmmproc is defined, we use that */
     if (rmmproc) {
-       vec = files++;          /* vec[0] = filevec[0] */
-       files[filep] = NULL;    /* NULL terminate list */
+       vec = argsplit(rmmproc, &program, &vecp);
+       files++;                /* Yes, we need to do this */
+       for (i = 0; i < filep; i++)
+               vec[vecp++] = files[i];
+       vec[vecp] = NULL;       /* NULL terminate list */
 
        fflush (stdout);
 
        fflush (stdout);
-       vec[0] = r1bindex (rmmproc, '/');
-       execvp (rmmproc, vec);
+       execvp (program, vec);
        adios (rmmproc, "unable to exec");
     }
 
        adios (rmmproc, "unable to exec");
     }