diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-10 13:21:18 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-10 13:21:18 +0000 |
commit | bb1251368e944c7cc779d718988d241c97fd0e04 (patch) | |
tree | 838e000d4d297512f8f719b264f3972f6582e2ce /main.c | |
parent | cdd9965f2080354017315270cbc3dc2da6378df9 (diff) | |
download | mandoc-bb1251368e944c7cc779d718988d241c97fd0e04.tar.gz |
Decide whether to use_pager as early as possible,
in preparation for pledge(2); no functional change intended.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) { @@ -420,9 +425,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, curp.mchars, defos); |