Skip to content

Commit 265f19d

Browse files
committed
Use isatty() test for pager on Win32; not sure why it was disabled for
that platform.
1 parent e2cd62c commit 265f19d

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/bin/psql/print.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.105 2008/05/17 21:40:44 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.106 2008/05/17 23:34:44 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -1912,13 +1912,7 @@ FILE *
19121912
PageOutput(int lines, unsigned short int pager)
19131913
{
19141914
/* check whether we need / can / are supposed to use pager */
1915-
if (pager
1916-
#ifndef WIN32
1917-
&&
1918-
isatty(fileno(stdin)) &&
1919-
isatty(fileno(stdout))
1920-
#endif
1921-
)
1915+
if (pager && isatty(fileno(stdin)) && isatty(fileno(stdout)))
19221916
{
19231917
const char *pagerprog;
19241918
FILE *pagerpipe;

src/interfaces/libpq/fe-print.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* didn't really belong there.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.75 2008/01/01 19:46:00 momjian Exp $
13+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.76 2008/05/17 23:34:44 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -147,13 +147,8 @@ PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
147147

148148
if (fout == NULL)
149149
fout = stdout;
150-
if (po->pager && fout == stdout
151-
#ifndef WIN32
152-
&&
153-
isatty(fileno(stdin)) &&
154-
isatty(fileno(stdout))
155-
#endif
156-
)
150+
if (po->pager && fout == stdout && isatty(fileno(stdin)) &&
151+
isatty(fileno(stdout)))
157152
{
158153
/*
159154
* If we think there'll be more than one screen of output, try to

0 commit comments

Comments
 (0)