mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Fixes: Floating point exception in psql
Submitted by: Dan McGuirk <mcguirk@indirect.com>
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.8 1996/07/28 06:54:15 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.9 1996/07/31 02:06:00 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -887,7 +887,9 @@ PQprint(FILE *fout,
|
|||||||
if (po->pager && fout == stdout && isatty(fileno(stdout))) {
|
if (po->pager && fout == stdout && isatty(fileno(stdout))) {
|
||||||
/* try to pipe to the pager program if possible */
|
/* try to pipe to the pager program if possible */
|
||||||
#ifdef TIOCGWINSZ
|
#ifdef TIOCGWINSZ
|
||||||
if (ioctl(fileno(stdout),TIOCGWINSZ,&screen_size) == -1)
|
if (ioctl(fileno(stdout),TIOCGWINSZ,&screen_size) == -1 ||
|
||||||
|
screen_size.ws_col == 0 ||
|
||||||
|
screen_size.ws_row == 0)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
screen_size.ws_row = 24;
|
screen_size.ws_row = 24;
|
||||||
@ -897,6 +899,7 @@ PQprint(FILE *fout,
|
|||||||
#endif
|
#endif
|
||||||
pagerenv=getenv("PAGER");
|
pagerenv=getenv("PAGER");
|
||||||
if (pagerenv != NULL &&
|
if (pagerenv != NULL &&
|
||||||
|
pagerenv[0] != '\0' &&
|
||||||
!po->html3 &&
|
!po->html3 &&
|
||||||
((po->expanded &&
|
((po->expanded &&
|
||||||
nTups * (nFields+1) >= screen_size.ws_row) ||
|
nTups * (nFields+1) >= screen_size.ws_row) ||
|
||||||
|
Reference in New Issue
Block a user