#include <h/tws.h>
#include <h/utils.h>
#include <setjmp.h>
-#include <signal.h>
-#include <errno.h>
#include <sys/types.h>
/*
char buf[BUFSIZ], *files[MAXARGS];
char **argp, **arguments;
+ /* Need this if called from main() of show(1). */
invo_name = r1bindex (argv[0], '/');
- /* read user profile/context */
- context_read();
-
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
folder = getenv ("mhfolder");
if (isatty (fileno (stdout))) {
- if (!nomore && !sc_hardcopy() && moreproc && *moreproc != '\0') {
+ if (!nomore && moreproc && *moreproc != '\0') {
if (mhl_action) {
SIGNAL (SIGINT, SIG_IGN);
SIGNAL2 (SIGQUIT, quitser);
}
if (clearflg > 0 && ontty == NOTTY)
- clear_screen ();
+ nmh_clear_screen ();
if (ontty == PITTY)
m_pclose ();
struct mcomp *c1;
struct stat st;
struct arglist *ap;
+ /* volatile to prevent "might be clobbered" warning from gcc: */
+ char *volatile fname2 = fname ? fname : "(stdin)";
switch (setjmp (env)) {
case OK:
return;
}
} else {
- fname = "(stdin)";
fp = stdin;
}
if (fstat(fileno(fp), &st) == 0) {
} else {
filesize = 0;
}
- cp = folder ? concat (folder, ":", fname, NULL) : getcpy (fname);
+ cp = folder ? concat (folder, ":", fname2, NULL) : getcpy (fname2);
if (ontty != PITTY)
SIGNAL (SIGINT, intrser);
mhlfile (fp, cp, ofilen, ofilec); /* FALL THROUGH! */
if (ofilec > 1) {
if (ofilen > 1) {
if ((global.c_flags & CLEARSCR))
- clear_screen ();
+ nmh_clear_screen ();
else
printf ("\n\n\n");
}
}
if (strchr(buf, '\n')) {
if ((global.c_flags & CLEARSCR))
- clear_screen ();
+ nmh_clear_screen ();
}
else
printf ("\n");
if (ofilen > 1) {
printf ("\n\n\n");
if (clearflg > 0)
- clear_screen ();
+ nmh_clear_screen ();
}
printf (">>> %s\n\n", mname);
}
if ((p = (struct pqpair *) calloc ((size_t) 1, sizeof(*p))) == NULL)
adios (NULL, "unable to allocate pqpair memory");
- if ((mp = getm (cp, NULL, 0, AD_NAME, error)) == NULL) {
+ if ((mp = getm (cp, NULL, 0, error, sizeof(error))) == NULL) {
p->pq_text = getcpy (cp);
p->pq_error = getcpy (error);
} else {
read (fileno (stdout), buf, sizeof(buf));
if (strchr(buf, '\n')) {
if (global.c_flags & CLEARSCR)
- clear_screen ();
+ nmh_clear_screen ();
row = 0;
} else {
putchar ('\n');
* buffers that we have duplicated from the parent.
*/
_exit(0);
- break;
case -1:
adios(NULL, "Unable to fork for filter writer process");
break;