]>
diplodocus.org Git - nmh/blob - sbr/refile.c
fea72e210afc52d4fb2eaca8edac502509a97003
1 /* refile.c -- call the "fileproc" to refile the
2 * -- msg or draft into another folder
4 * This code is Copyright (c) 2002, by the authors of nmh. See the
5 * COPYRIGHT file in the root directory of the nmh distribution for
6 * complete copyright information.
15 refile (char **arg
, char *file
)
22 vec
= argsplit(fileproc
, &program
, &vecp
);
24 vec
[vecp
++] = mh_xstrdup("-nolink"); /* override bad .mh_profile defaults */
25 vec
[vecp
++] = mh_xstrdup("-nopreserve");
26 vec
[vecp
++] = mh_xstrdup("-file");
27 vec
[vecp
++] = getcpy(file
);
31 vec
[vecp
++] = mh_xstrdup(*arg
++);
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);