Module Name:    src
Committed By:   christos
Date:           Tue May  5 18:52:13 UTC 2009

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

Log Message:
PR/41358: YAMAMOTO Takashi: top -n is broken, don't return -1 early if
!smartterminal


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/top/dist/display.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/display.c
diff -u src/external/bsd/top/dist/display.c:1.6 src/external/bsd/top/dist/display.c:1.7
--- src/external/bsd/top/dist/display.c:1.6	Tue May  5 14:51:21 2009
+++ src/external/bsd/top/dist/display.c	Tue May  5 14:52:13 2009
@@ -717,14 +717,17 @@
 	memzero(colorbuf, bufsize);
     }
 
+    /* for dumb terminals, pretend like we can show any amount */
+    if (!smart_terminal)
+	return Largest;
+
     /* adjust total lines on screen to lines available for procs */
     if (top_lines < y_procs)
 	return -1;
     top_lines -= y_procs;
 
     /* return number of lines available */
-    /* for dumb terminals, pretend like we can show any amount */
-    return(smart_terminal ? top_lines : Largest);
+    return top_lines;
 }
 
 int

Reply via email to