{ "form formfile", 0 },
#define PROGSW 6
{ "moreproc program", 0 },
-#define NPROGSW 7
- { "nomoreproc", 0 },
-#define LENSW 8
+#define LENSW 7
{ "length lines", 0 },
-#define WIDTHSW 9
+#define WIDTHSW 8
{ "width columns", 0 },
-#define SLEEPSW 10
+#define SLEEPSW 9
{ "sleep seconds", 0 },
-#define VERSIONSW 11
+#define VERSIONSW 10
{ "version", 0 },
-#define HELPSW 12
+#define HELPSW 11
{ "help", 0 },
-#define FORW1SW 13
+#define FORW1SW 12
{ "forward", -7 },
-#define FORW2SW 14
+#define FORW2SW 13
{ "forwall", -7 },
-#define DGSTSW 15
+#define DGSTSW 14
{ "digest list", -6 },
-#define VOLUMSW 16
+#define VOLUMSW 15
{ "volume number", -6 },
-#define ISSUESW 17
+#define ISSUESW 16
{ "issue number", -5 },
-#define NBODYSW 18
+#define NBODYSW 17
{ "nobody", -6 },
{ NULL, 0 }
};
#define PITTY (-1)
#define NOTTY 0
-#define ISTTY 1
static int ontty = NOTTY;
static int row;
int SOprintf(char *, ...); /* from termsbr.c */
int sc_width(void); /* from termsbr.c */
int sc_length(void); /* from termsbr.c */
-int sc_hardcopy(void); /* from termsbr.c */
int
main(int argc, char **argv)
{
- int length = 0, nomore = 0;
+ int length = 0;
int i, width = 0, vecp = 0;
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;
- case NPROGSW:
- nomore++;
- continue;
case LENSW:
if (!(cp = *argp++) || *cp == '-')
folder = getenv("mhfolder");
if (isatty(fileno(stdout))) {
- if (!nomore && !sc_hardcopy() && moreproc && *moreproc != '\0') {
- 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');