Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e0d48c3

Browse files
committed
Fixes: Floating point exception in psql
Submitted by: Dan McGuirk <mcguirk@indirect.com>
1 parent 74cdf92 commit e0d48c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/interfaces/libpq/fe-exec.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.8 1996/07/28 06:54:15 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.9 1996/07/31 02:06:00 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -887,7 +887,9 @@ PQprint(FILE *fout,
887887
if (po->pager && fout == stdout && isatty(fileno(stdout))) {
888888
/* try to pipe to the pager program if possible */
889889
#ifdef TIOCGWINSZ
890-
if (ioctl(fileno(stdout),TIOCGWINSZ,&screen_size) == -1)
890+
if (ioctl(fileno(stdout),TIOCGWINSZ,&screen_size) == -1 ||
891+
screen_size.ws_col == 0 ||
892+
screen_size.ws_row == 0)
891893
{
892894
#endif
893895
screen_size.ws_row = 24;
@@ -897,6 +899,7 @@ PQprint(FILE *fout,
897899
#endif
898900
pagerenv=getenv("PAGER");
899901
if (pagerenv != NULL &&
902+
pagerenv[0] != '\0' &&
900903
!po->html3 &&
901904
((po->expanded &&
902905
nTups * (nFields+1) >= screen_size.ws_row) ||

0 commit comments

Comments
 (0)