]>
diplodocus.org Git - nmh/blob - sbr/showfile.c
703132bdc5fb2fb5db8db9434779dca8df1fa579
1 /* showfile.c -- invoke the `lproc' command
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
13 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
= fork()) {
34 advise ("fork", "unable to");
39 vec
= argsplit(lproc
, &program
, &vecp
);
49 if (!strcmp (vec
[0], "show"))
50 vec
[vecp
++] = "-file";
55 execvp (program
, vec
);
56 fprintf (stderr
, "unable to exec ");
62 retval
= pidwait (pid
, -1) & 0377 ? 1 : 0;