]> diplodocus.org Git - nmh/blobdiff - uip/mhlsbr.c
mhshow/test-charset: Use octal, not hex, in printf(1) format string.
[nmh] / uip / mhlsbr.c
index bf3ed232abc606d0541c5c68dcc214b8fbcc0648..5c050e3e33a1a70fcd91b63514de1ee4300d4eb3 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/addrsbr.h>
 #include <h/fmt_scan.h>
 #include <h/tws.h>
+#include "h/done.h"
 #include <h/utils.h>
 #include "sbr/m_popen.h"
 #include <setjmp.h>
@@ -298,14 +299,11 @@ static int num_ignores = 0;
 static char *ignores[MAXARGS];
 
 static  jmp_buf env;
-static  jmp_buf mhlenv;
 
 static char delim3[] =         /* from forw.c */
     "\n----------------------------------------------------------------------\n\n";
 static char delim4[] = "\n------------------------------\n\n";
 
-static FILE *(*mhl_action)(char *);
-
 /*
  * prototypes
  */
@@ -476,12 +474,8 @@ mhl (int argc, char **argv)
 
     if (isatty (fileno (stdout))) {
        if (!nomore && moreproc && *moreproc != '\0') {
-           if (mhl_action) {
-               SIGNAL (SIGINT, SIG_IGN);
-               SIGNAL2 (SIGQUIT, quitser);
-           }
            SIGNAL2 (SIGPIPE, pipeser);
-           m_popen (moreproc, mhl_action != NULL);
+           m_popen(moreproc, false);
            ontty = PITTY;
        } else {
            SIGNAL (SIGINT, SIG_IGN);
@@ -880,7 +874,7 @@ process (char *folder, char *fname, int ofilen, int ofilec)
     switch (setjmp (env)) {
        case OK: 
            if (fname) {
-               fp = mhl_action ? (*mhl_action) (fname) : fopen (fname, "r");
+               fp = fopen(fname, "r");
                if (fp == NULL) {
                    advise (fname, "unable to open");
                    exitstat++;
@@ -912,7 +906,7 @@ process (char *folder, char *fname, int ofilen, int ofilec)
        default:
            if (ontty != PITTY)
                SIGNAL (SIGINT, SIG_IGN);
-           if (mhl_action == NULL && fp != stdin && fp != NULL)
+           if (fp != stdin && fp != NULL)
                fclose (fp);
             free(holder.c_text);
             holder.c_text = NULL;
@@ -1662,8 +1656,6 @@ static void
 mhldone (int status)
 {
     exitstat = status;
-    if (mhl_action)
-       longjmp (mhlenv, DONE);
     done (exitstat);
 }