summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2008-05-17 23:34:44 +0000
committerBruce Momjian2008-05-17 23:34:44 +0000
commitcd1036d3305170af71cd38025e6c3d48e5f94ffe (patch)
tree0f840382d68314b02aab8b8b39c0fd53e211eed9
parentb6c4c5aa82e68e479604ad4e21c7f2d224befbaa (diff)
Use isatty() test for pager on Win32; not sure why it was disabled for
that platform.
-rw-r--r--src/bin/psql/print.c8
-rw-r--r--src/interfaces/libpq/fe-print.c9
2 files changed, 3 insertions, 14 deletions
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