]>
diplodocus.org Git - nmh/blob - sbr/showfile.c
3 * showfile.c -- invoke the `lproc' command
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
14 showfile (char **arg
, char *file
)
21 context_save(); /* save the context file */
25 * If you have your lproc listed as "mhl",
26 * then really invoked the mhlproc instead
27 * (which is usually mhl anyway).
29 if (!strcmp (r1bindex (lproc
, '/'), "mhl"))
32 switch (pid
= fork()) {
35 advise ("fork", "unable to");
40 vec
= argsplit(lproc
, &program
, &vecp
);
50 if (!strcmp (vec
[0], "show"))
51 vec
[vecp
++] = "-file";
56 execvp (program
, vec
);
57 fprintf (stderr
, "unable to exec ");
63 retval
= pidwait (pid
, -1) & 0377 ? 1 : 0;