moreproc will always be set in config/config.c, thus eliminated the ISTTY case.
[mmh] / uip / mhl.c
index b1410ad..98e58d0 100644 (file)
--- 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 <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) {
@@ -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');