Currently if you resize an xterm that top(1) is running in to too few lines
for any processes to be shown and then type 'n' to show X process lines, top
will display a message saying:

 This terminal can only display -Y processes.
 
Obviously a negative number is not quite correct. This diff makes top display:

 This terminal can only display 0 processes.

Perhaps the grammar is not great...but...

ok?

-lum

Index: display.c
===================================================================
RCS file: /cvs/src/usr.bin/top/display.c,v
retrieving revision 1.41
diff -u -p -r1.41 display.c
--- display.c   16 Dec 2011 14:50:24 -0000      1.41
+++ display.c   11 Apr 2012 18:26:44 -0000
@@ -147,6 +147,9 @@ display_resize(void)
        if (display_width >= MAX_COLS)
                display_width = MAX_COLS - 1;
 
+       if (display_lines < 0)
+               display_lines = 0;
+
        /* return number of lines available */
        /* for dumb terminals, pretend like we can show any amount */
        return (smart_terminal ? display_lines : Largest);
@@ -196,9 +199,6 @@ display_init(struct statics * statics)
                        cpustate_total_length += i + 8;
                }
        }
-
-       if (display_lines < 0)
-               display_lines = 0;
 
        /* return number of lines available */
        return (display_lines);

Reply via email to