mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Use isatty() test for pager on Win32; not sure why it was disabled for
that platform.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
* 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"
|
#include "postgres_fe.h"
|
||||||
|
|
||||||
@ -1912,13 +1912,7 @@ FILE *
|
|||||||
PageOutput(int lines, unsigned short int pager)
|
PageOutput(int lines, unsigned short int pager)
|
||||||
{
|
{
|
||||||
/* check whether we need / can / are supposed to use pager */
|
/* check whether we need / can / are supposed to use pager */
|
||||||
if (pager
|
if (pager && isatty(fileno(stdin)) && isatty(fileno(stdout)))
|
||||||
#ifndef WIN32
|
|
||||||
&&
|
|
||||||
isatty(fileno(stdin)) &&
|
|
||||||
isatty(fileno(stdout))
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const char *pagerprog;
|
const char *pagerprog;
|
||||||
FILE *pagerpipe;
|
FILE *pagerpipe;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* didn't really belong there.
|
* didn't really belong there.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
if (fout == NULL)
|
||||||
fout = stdout;
|
fout = stdout;
|
||||||
if (po->pager && fout == stdout
|
if (po->pager && fout == stdout && isatty(fileno(stdin)) &&
|
||||||
#ifndef WIN32
|
isatty(fileno(stdout)))
|
||||||
&&
|
|
||||||
isatty(fileno(stdin)) &&
|
|
||||||
isatty(fileno(stdout))
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If we think there'll be more than one screen of output, try to
|
* If we think there'll be more than one screen of output, try to
|
||||||
|
Reference in New Issue
Block a user