source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Decide whether to use_pager as early as possible,  in
@ 2015-10-10 13:21 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-10-10 13:21 UTC (permalink / raw)
  To: source

Log Message:
-----------
Decide whether to use_pager as early as possible, 
in preparation for pledge(2); no functional change intended.

Modified Files:
--------------
    mdocml:
        main.c

Revision Data
-------------
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.c,v
retrieving revision 1.245
retrieving revision 1.246
diff -Lmain.c -Lmain.c -u -p -r1.245 -r1.246
--- main.c
+++ main.c
@@ -289,6 +289,11 @@ main(int argc, char *argv[])
 		}
 	}
 
+	if (outmode == OUTMODE_FLN ||
+	    outmode == OUTMODE_LST ||
+	    !isatty(STDOUT_FILENO))
+		use_pager = 0;
+
 	/* Parse arguments. */
 
 	if (argc > 0) {
@@ -419,9 +424,6 @@ main(int argc, char *argv[])
 
 	if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths))
 		return (int)MANDOCLEVEL_BADARG;
-
-	if (use_pager && ! isatty(STDOUT_FILENO))
-		use_pager = 0;
 
 	curp.mchars = mchars_alloc();
 	curp.mp = mparse_alloc(options, curp.wlevel, mmsg,
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-10 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 13:21 mdocml: Decide whether to use_pager as early as possible, in schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).