X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0bfb53a23531bea3aaeadcd1a6f6c372eef96612..a1067dea91a4cb3fc71b0b33271d2c7c9c8a2d7a:/uip/refile.c diff --git a/uip/refile.c b/uip/refile.c index ae71de23..8dd04fb9 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -195,7 +195,7 @@ main (int argc, char **argv) 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 */ @@ -282,7 +282,7 @@ opnfolds (struct st_fold *folders, int nfolders) 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; @@ -321,17 +321,19 @@ clsfolds (struct st_fold *folders, int nfolders) 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) { - 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); - vec[0] = r1bindex (rmmproc, '/'); - execvp (rmmproc, vec); + execvp (program, vec); adios (rmmproc, "unable to exec"); }