]>
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.
16 refile (char **arg
, char *file
)
23 vec
= argsplit(fileproc
, &program
, &vecp
);
25 vec
[vecp
++] = mh_xstrdup("-nolink"); /* override bad .mh_profile defaults */
26 vec
[vecp
++] = mh_xstrdup("-nopreserve");
27 vec
[vecp
++] = mh_xstrdup("-file");
28 vec
[vecp
++] = getcpy(file
);
32 vec
[vecp
++] = mh_xstrdup(*arg
++);
36 context_save(); /* save the context file */
39 switch (pid
= fork()) {
41 advise ("fork", "unable to");
45 execvp (program
, vec
);
46 fprintf (stderr
, "unable to exec ");
51 arglist_free(program
, vec
);
52 return (pidwait (pid
, -1));