Use isatty() test for pager on Win32; not sure why it was disabled for
authorBruce Momjian <bruce@momjian.us>
Sat, 17 May 2008 23:34:44 +0000 (23:34 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 17 May 2008 23:34:44 +0000 (23:34 +0000)
that platform.

src/bin/psql/print.c
src/interfaces/libpq/fe-print.c

index 1a7ed64bcd2eb0b4e2c7bd47774ba984b5293d56..dcd1a10069ba8e9a5251c24fd772ee6648fffb85 100644 (file)
@@ -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;
index 77c0d1d6d53c4357b644a0660e3ce58a9e0db2ff..7fe1b5d8e3c0aa17de0f51b4eef21070287ae0e6 100644 (file)
@@ -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