From: Bruce Momjian Date: Sat, 17 May 2008 23:34:44 +0000 (+0000) Subject: Use isatty() test for pager on Win32; not sure why it was disabled for X-Git-Tag: recoveryinfrav9~1011 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=cd1036d3305170af71cd38025e6c3d48e5f94ffe;p=users%2Fsimon%2Fpostgres.git Use isatty() test for pager on Win32; not sure why it was disabled for that platform. --- diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 1a7ed64bcd..dcd1a10069 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -1912,13 +1912,7 @@ FILE * PageOutput(int lines, unsigned short int pager) { /* check whether we need / can / are supposed to use pager */ - if (pager -#ifndef WIN32 - && - isatty(fileno(stdin)) && - isatty(fileno(stdout)) -#endif - ) + if (pager && isatty(fileno(stdin)) && isatty(fileno(stdout))) { const char *pagerprog; FILE *pagerpipe; diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 77c0d1d6d5..7fe1b5d8e3 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -147,13 +147,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po) if (fout == NULL) fout = stdout; - if (po->pager && fout == stdout -#ifndef WIN32 - && - isatty(fileno(stdin)) && - isatty(fileno(stdout)) -#endif - ) + if (po->pager && fout == stdout && isatty(fileno(stdin)) && + isatty(fileno(stdout))) { /* * If we think there'll be more than one screen of output, try to