Commit e0d48c31 authored by Marc G. Fournier's avatar Marc G. Fournier

Fixes: Floating point exception in psql

Submitted by: Dan McGuirk <mcguirk@indirect.com>
parent 74cdf928
...@@ -7,7 +7,7 @@ ...@@ -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, ...@@ -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, ...@@ -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) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment