aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2008-05-17 23:34:44 +0000
committerBruce Momjian <bruce@momjian.us>2008-05-17 23:34:44 +0000
commit265f19d78bb37d176d23878db93943972e38ef34 (patch)
tree7ed737544368765f5278f63d0035de5c632ebbad
parente2cd62c3e1e666b11f6e569b21bbe1b7c6acbe8f (diff)
downloadpostgresql-265f19d78bb37d176d23878db93943972e38ef34.tar.gz
postgresql-265f19d78bb37d176d23878db93943972e38ef34.zip
Use isatty() test for pager on Win32; not sure why it was disabled for
that platform.
-rw-r--r--src/bin/psql/print.c10
-rw-r--r--src/interfaces/libpq/fe-print.c11
2 files changed, 5 insertions, 16 deletions
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index ad57cae9a8e..b0cf7f5bdb1 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.105 2008/05/17 21:40:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.106 2008/05/17 23:34:44 momjian Exp $
*/
#include "postgres_fe.h"
@@ -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 a2dbc345d72..efbd4b95282 100644
--- a/src/interfaces/libpq/fe-print.c
+++ b/src/interfaces/libpq/fe-print.c
@@ -10,7 +10,7 @@
* didn't really belong there.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.75 2008/01/01 19:46:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.76 2008/05/17 23:34:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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