]>
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
)
20 context_save(); /* save the context file */
24 * If you have your lproc listed as "mhl",
25 * then really invoked the mhlproc instead
26 * (which is usually mhl anyway).
28 if (!strcmp (r1bindex (lproc
, '/'), "mhl"))
31 switch (pid
= vfork()) {
34 advise ("fork", "unable to");
40 vec
[vecp
++] = r1bindex (lproc
, '/');
50 if (!strcmp (vec
[0], "show"))
51 vec
[vecp
++] = "-file";
57 fprintf (stderr
, "unable to exec ");
63 return (pidwait (pid
, -1) & 0377 ? 1 : 0);
66 return 1; /* NOT REACHED */