+ register char *cp;
+ int c, nlines;
+ int brokpipe();
+ FILE *ibuf, *obuf;
+
+ obuf = stdout;
+ if (setjmp(pipestop)) {
+ if (obuf != stdout) {
+ pclose(obuf);
+ pipef = NULL;
+ }
+ sigset(SIGPIPE, SIG_DFL);
+ return(0);
+ }
+ if (intty && outtty && (cp = value("crt")) != NOSTR) {
+ for (ip = msgvec, nlines = 0; *ip && ip-msgvec < msgCount; ip++)
+ nlines += message[*ip - 1].m_lines;
+ if (nlines > atoi(cp)) {
+ obuf = popen(MORE, "w");
+ if (obuf == NULL) {
+ perror(MORE);
+ obuf = stdout;
+ }
+ else {
+ pipef = obuf;
+ sigset(SIGPIPE, brokpipe);
+ }
+ }
+ }