#define PITTY (-1)
#define NOTTY 0
-#define ISTTY 1
static int ontty = NOTTY;
static int row;
char *cp, *folder = NULL, *form = NULL;
char buf[BUFSIZ], *files[MAXARGS];
char **argp, **arguments;
+ char *progsw = NULL;
#ifdef LOCALE
setlocale(LC_ALL, "");
continue;
case PROGSW:
- if (!(moreproc = *argp++) || *moreproc == '-')
+ if (!(progsw = *argp++) || *progsw == '-')
adios(NULL, "missing argument to %s",
argp[-2]);
continue;
folder = getenv("mhfolder");
if (isatty(fileno(stdout))) {
- if (moreproc && *moreproc) {
- if (mhl_action) {
- SIGNAL(SIGINT, SIG_IGN);
- SIGNAL2(SIGQUIT, quitser);
- }
- SIGNAL2(SIGPIPE, pipeser);
- m_popen(moreproc);
- ontty = PITTY;
- } else {
+ if (mhl_action) {
SIGNAL(SIGINT, SIG_IGN);
SIGNAL2(SIGQUIT, quitser);
- ontty = ISTTY;
}
+ SIGNAL2(SIGPIPE, pipeser);
+ m_popen(progsw ? progsw : moreproc);
+ ontty = PITTY;
} else {
ontty = NOTTY;
}
cp = folder ? concat(folder, ":", fname, NULL) : getcpy(fname);
if (ontty != PITTY)
SIGNAL(SIGINT, intrser);
- mhlfile(fp, cp, ofilen, ofilec); /* FALL THROUGH! */
-
+ mhlfile(fp, cp, ofilen, ofilec);
+ /* FALL THROUGH! */
default:
if (ontty != PITTY)
SIGNAL(SIGINT, SIG_IGN);
}
break;
- case ISTTY:
- strncpy(buf, "\n", sizeof(buf));
- if (ofilec > 1) {
- if (SOprintf("Press <return> to list \"%s\"...", mname)) {
- if (ofilen > 1)
- printf("\n\n\n");
- printf("Press <return> to list \"%s\"...", mname);
- }
- fflush(stdout);
- buf[0] = 0;
- read(fileno(stdout), buf, sizeof(buf));
- }
- if (strchr(buf, '\n')) {
- if ((global.c_flags & CLEARSCR))
- clear_screen();
- } else
- printf("\n");
- break;
-
default:
if (ofilec > 1) {
if (ofilen > 1) {
llim--;
column = 0;
row++;
- if (ontty != ISTTY || row != global.c_length)
+ if (row != global.c_length)
break;
if (global.c_flags & BELL)
putchar('\007');
*/
if (!alternate || ct->c_subtype == TEXT_PLAIN) {
snprintf(buffer, sizeof(buffer), "%%p%s '%%F'",
- progsw ? progsw : moreproc && *moreproc ?
- moreproc : "more");
+ progsw ? progsw : moreproc);
cp = (ct->c_showproc = getcpy(buffer));
return show_content_aux(ct, serial, alternate, cp, NULL);
}