X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhshowsbr.c;h=5abd67dc353b5d568a8e96a69b89791a086a6010;hb=5ea646bd6534ab3b4d228c1c20998fdfa69ecfcf;hp=44371f1c7ca01fe49ec8c9aae5480af556eaf5a3;hpb=3a84d814004fd4557bf4f44952648e9e69bd22a8;p=mmh diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 44371f1..5abd67d 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -469,7 +469,8 @@ raw: } } - if (buflen <= 0 || (ct->c_termproc && buflen <= strlen(ct->c_termproc))) { + if (buflen <= 0 || + (ct->c_termproc && (size_t) buflen <= strlen(ct->c_termproc))) { /* content_error would provide a more useful error message * here, except that if we got overrun, it probably would * too. @@ -532,15 +533,15 @@ show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer else list_switch (ct, -1, 1, 0, 0); - if (xpause && SOprintf ("Press to show content...")) - printf ("Press to show content..."); - - if (xpause) { + if (xpause && isatty (fileno (stdout))) { int intr; + + if (SOprintf ("Press to show content...")) + printf ("Press to show content..."); SIGNAL_HANDLER istat; istat = SIGNAL (SIGINT, intrser); - if ((intr = sigsetjmp (intrenv, 1)) == OK) { + if ((intr = m_sigsetjmp (intrenv, 1)) == OK) { fflush (stdout); prompt[0] = 0; read (fileno (stdout), prompt, sizeof(prompt)); @@ -563,7 +564,7 @@ show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer fflush (stdout); - for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++) + for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++) sleep (5); switch (child_id) { case NOTOK: @@ -984,7 +985,8 @@ raw: } } - if (buflen <= 0 || (ct->c_termproc && buflen <= strlen(ct->c_termproc))) { + if (buflen <= 0 || + (ct->c_termproc && (size_t) buflen <= strlen(ct->c_termproc))) { /* content_error would provide a more useful error message * here, except that if we got overrun, it probably would * too.