Module Name:    src
Committed By:   roy
Date:           Tue Oct  1 11:39:38 UTC 2013

Modified Files:
        src/external/bsd/top/dist: screen.c

Log Message:
Allow interactive displays if the termcap entry does not have the `li'
setting but we can calculate the lines from ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/top/dist/screen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/top/dist/screen.c
diff -u src/external/bsd/top/dist/screen.c:1.4 src/external/bsd/top/dist/screen.c:1.5
--- src/external/bsd/top/dist/screen.c:1.4	Sat Dec 24 22:29:48 2011
+++ src/external/bsd/top/dist/screen.c	Tue Oct  1 11:39:37 2013
@@ -273,8 +273,7 @@ screen_readtermcap(int interactive)
     /* set up common terminal capabilities */
     if ((screen_length = tgetnum("li")) <= 0)
     {
-	screen_length = smart_terminal = 0;
-	return No;
+	screen_length = 0;
     }
 
     /* screen_width is a little different */
@@ -329,6 +328,13 @@ screen_readtermcap(int interactive)
        sets lower_left. */
     screen_getsize();
 
+    /* If screen_length is 0 from both termcap and ioctl then we are dumb */
+    if (screen_length == 0)
+    {
+        smart_terminal = No;
+        return No;
+    }
+
     /* if stdout is not a terminal, pretend we are a dumb terminal */
 #ifdef USE_SGTTY
     if (ioctl(STDOUT, TIOCGETP, &old_settings) == -1)

Reply via email to