From: markus schnalke Date: Fri, 10 Feb 2012 15:05:20 +0000 (+0100) Subject: moreproc will always be set in config/config.c, thus eliminated the ISTTY case. X-Git-Tag: mmh-thesis-end~315 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=dee26acad9bca6aec7dca5c428b07a386909081b;p=mmh moreproc will always be set in config/config.c, thus eliminated the ISTTY case. --- diff --git a/uip/mhl.c b/uip/mhl.c index b1410ad..98e58d0 100644 --- a/uip/mhl.c +++ b/uip/mhl.c @@ -198,7 +198,6 @@ static int mhldebug = 0; #define PITTY (-1) #define NOTTY 0 -#define ISTTY 1 static int ontty = NOTTY; static int row; @@ -279,6 +278,7 @@ main(int argc, char **argv) char *cp, *folder = NULL, *form = NULL; char buf[BUFSIZ], *files[MAXARGS]; char **argp, **arguments; + char *progsw = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); @@ -345,7 +345,7 @@ main(int argc, char **argv) continue; case PROGSW: - if (!(moreproc = *argp++) || *moreproc == '-') + if (!(progsw = *argp++) || *progsw == '-') adios(NULL, "missing argument to %s", argp[-2]); continue; @@ -409,19 +409,13 @@ main(int argc, char **argv) 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; } @@ -787,8 +781,8 @@ process(char *folder, char *fname, int ofilen, int ofilec) 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); @@ -840,25 +834,6 @@ mhlfile(FILE *fp, char *mname, int ofilen, int ofilec) } break; - case ISTTY: - strncpy(buf, "\n", sizeof(buf)); - if (ofilec > 1) { - if (SOprintf("Press to list \"%s\"...", mname)) { - if (ofilen > 1) - printf("\n\n\n"); - printf("Press 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) { @@ -1328,7 +1303,7 @@ putch(char ch) llim--; column = 0; row++; - if (ontty != ISTTY || row != global.c_length) + if (row != global.c_length) break; if (global.c_flags & BELL) putchar('\007'); diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index e05dddf..c81cf92 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -625,8 +625,7 @@ show_text(CT ct, int serial, int alternate) */ 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); }