diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-07-19 00:07:42 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-07-19 00:07:42 +0000 |
commit | 20a972b9c7a4dc0048c55dd8cb3a9bc426793851 (patch) | |
tree | cbcd1c86bf019be1a72fac04266152050391ec3d /main.c | |
parent | 43d1748cc0562a70dde2e6b375fe7f4a062b636f (diff) | |
download | mandoc-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |