From 05e70794c04dd2ab455d1d3b8937e195f7cd0f8c Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Tue, 3 Sep 1991 16:26:06 +0000
Subject: [PATCH] If the terminal rows/columns are 0, then return NIL (meaning
 value unknown.)

---
 hemlock/tty-disp-rt.lisp | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/hemlock/tty-disp-rt.lisp b/hemlock/tty-disp-rt.lisp
index 6217e76c9..7c5ebe1a3 100644
--- a/hemlock/tty-disp-rt.lisp
+++ b/hemlock/tty-disp-rt.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/tty-disp-rt.lisp,v 1.1.1.3 1991/03/14 16:25:48 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/tty-disp-rt.lisp,v 1.1.1.4 1991/09/03 16:26:06 ram Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -69,15 +69,17 @@
     (mach::with-trap-arg-block mach:sgtty sgtty
       (let ((size-win (mach:unix-ioctl fd mach:TIOCGWINSZ (alien-sap winsize)))
 	    (speed-win (mach:unix-ioctl fd mach:TIOCGETP (alien-sap sgtty))))
-	(values
-	 (and size-win
-	      (alien-access (mach:winsize-ws_row winsize)))
-	 (and size-win
-	      (alien-access (mach:winsize-ws_col winsize)))
-	 (and speed-win
-	      (setq *terminal-baud-rate*
-		    (svref mach:terminal-speeds
-			   (alien-access (mach:sgtty-ospeed sgtty))))))))))
+	(flet ((frob (val)
+		 (if (and size-win (not (zerop val)))
+		     val
+		     nil)))
+	  (values
+	   (frob (alien-access (mach:winsize-ws_row winsize)))
+	   (frob (alien-access (mach:winsize-ws_col winsize)))
+	   (and speed-win
+		(setq *terminal-baud-rate*
+		      (svref mach:terminal-speeds
+			     (alien-access (mach:sgtty-ospeed sgtty)))))))))))
 
 ;;;; Output routines and buffering.
 
-- 
GitLab