]>
diplodocus.org Git - nmh/blob - sbr/refile.c
3 * refile.c -- call the "fileproc" to refile the
4 * -- msg or draft into another folder
6 * This code is Copyright (c) 2002, by the authors of nmh. See the
7 * COPYRIGHT file in the root directory of the nmh distribution for
8 * complete copyright information.
15 refile (char **arg
, char *file
)
22 vec
= argsplit(fileproc
, &program
, &vecp
);
24 vec
[vecp
++] = getcpy("-nolink"); /* override bad .mh_profile defaults */
25 vec
[vecp
++] = getcpy("-nopreserve");
26 vec
[vecp
++] = getcpy("-file");
27 vec
[vecp
++] = getcpy(file
);
35 context_save(); /* save the context file */
38 switch (pid
= fork()) {
40 advise ("fork", "unable to");
44 execvp (program
, vec
);
45 fprintf (stderr
, "unable to exec ");
50 arglist_free(program
, vec
);
51 return (pidwait (pid
, -1));