]> granicus.if.org Git - postgresql/commitdiff
Fixes: Floating point exception in psql
authorMarc G. Fournier <scrappy@hub.org>
Wed, 31 Jul 1996 02:06:00 +0000 (02:06 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Wed, 31 Jul 1996 02:06:00 +0000 (02:06 +0000)
Submitted by: Dan McGuirk <mcguirk@indirect.com>

src/interfaces/libpq/fe-exec.c

index 781190cf5ac48eb2e323984e061a4d41387f0783..eeb4ae29dc55702e6d54f9b2584a0d9fd6cc90d9 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * 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))) {
                /* try to pipe to the pager program if possible */
 #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
                        screen_size.ws_row = 24;
@@ -897,6 +899,7 @@ PQprint(FILE *fout,
 #endif
                pagerenv=getenv("PAGER");
                if (pagerenv != NULL &&
+                   pagerenv[0] != '\0' && 
                   !po->html3 &&
                   ((po->expanded &&
                        nTups * (nFields+1) >= screen_size.ws_row) ||