X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Frefile.c;h=55ba754e8797729dfb18e7745da170da8d73e023;hb=dee26acad9bca6aec7dca5c428b07a386909081b;hp=5637d6f84393a3e332380972933f3ba5b8230d1b;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1;p=mmh diff --git a/sbr/refile.c b/sbr/refile.c index 5637d6f..55ba754 100644 --- a/sbr/refile.c +++ b/sbr/refile.c @@ -1,24 +1,24 @@ /* - * refile.c -- call the "fileproc" to refile the - * -- msg or draft into another folder - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** refile.c -- call the "fileproc" to refile the +** -- msg or draft into another folder +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include int -refile (char **arg, char *file) +refile(char **arg, char *file) { pid_t pid; register int vecp; char *vec[MAXARGS]; vecp = 0; - vec[vecp++] = r1bindex (fileproc, '/'); + vec[vecp++] = mhbasename(fileproc); vec[vecp++] = "-nolink"; /* override bad .mh_profile defaults */ vec[vecp++] = "-nopreserve"; vec[vecp++] = "-file"; @@ -33,18 +33,18 @@ refile (char **arg, char *file) context_save(); /* save the context file */ fflush(stdout); - switch (pid = vfork()) { - case -1: - advise ("fork", "unable to"); - return -1; + switch (pid = fork()) { + case -1: + advise("fork", "unable to"); + return -1; - case 0: - execvp (fileproc, vec); - fprintf (stderr, "unable to exec "); - perror (fileproc); - _exit (-1); + case 0: + execvp(fileproc, vec); + fprintf(stderr, "unable to exec "); + perror(fileproc); + _exit(-1); - default: - return (pidwait (pid, -1)); + default: + return (pidwait(pid, -1)); } }