=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.239 retrieving revision 1.242 diff -u -p -r1.239 -r1.242 --- mandoc/main.c 2015/07/17 22:38:29 1.239 +++ mandoc/main.c 2015/07/19 06:05:16 1.242 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.239 2015/07/17 22:38:29 schwarze Exp $ */ +/* $Id: main.c,v 1.242 2015/07/19 06:05:16 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -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, ""); } @@ -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) @@ -455,10 +458,6 @@ main(int argc, char *argv[]) passthrough(resp->file, fd, conf.output.synopsisonly); - rctmp = mparse_wait(curp.mp); - if (rc < rctmp) - rc = rctmp; - if (argc > 1 && curp.outtype <= OUTT_UTF8) ascii_sepline(curp.outdata); } @@ -570,7 +569,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, free(file); } - mandoc_asprintf(&file, "%s/man%s/%s.*", + mandoc_asprintf(&file, "%s/man%s/%s.[01-9]*", paths->paths[ipath], sec, name); globres = glob(file, 0, NULL, &globinfo); if (globres != 0 && globres != GLOB_NOMATCH)