summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index a1eca5e7..4c7137cf 100644
--- a/main.c
+++ b/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) {
@@ -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);