summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-07-19 00:07:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-07-19 00:07:42 +0000
commit20a972b9c7a4dc0048c55dd8cb3a9bc426793851 (patch)
treecbcd1c86bf019be1a72fac04266152050391ec3d /main.c
parent43d1748cc0562a70dde2e6b375fe7f4a062b636f (diff)
downloadmandoc-20a972b9c7a4dc0048c55dd8cb3a9bc426793851.tar.gz
If we aren't on a tty, clear the pager flag up front.
Just to clean up code structure, no functional change.
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 5dc3e7c8..1ec130e9 100644
--- a/main.c
+++ b/main.c
@@ -419,6 +419,9 @@ main(int argc, char *argv[])
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths))
return((int)MANDOCLEVEL_BADARG);
+ if (pager_pid == 1 && isatty(STDOUT_FILENO) == 0)
+ pager_pid = 0;
+
curp.mchars = mchars_alloc();
curp.mp = mparse_alloc(options, curp.wlevel, mmsg,
curp.mchars, defos);
@@ -430,7 +433,7 @@ main(int argc, char *argv[])
mparse_keep(curp.mp);
if (argc < 1) {
- if (pager_pid == 1 && isatty(STDOUT_FILENO))
+ if (pager_pid == 1)
pager_pid = spawn_pager();
parse(&curp, STDIN_FILENO, "<stdin>");
}
@@ -442,7 +445,7 @@ main(int argc, char *argv[])
rc = rctmp;
if (fd != -1) {
- if (pager_pid == 1 && isatty(STDOUT_FILENO))
+ if (pager_pid == 1)
pager_pid = spawn_pager();
if (resp == NULL)