added auto ping and obs count to dxchan
[spider.git] / perl / console.pl
index a0e4f1087a676825397a46a0e2a0fb8cb19b9ff2..887600e31ee6438ca9f96188b13fd5c2e60b5d93 100755 (executable)
@@ -137,10 +137,9 @@ sub measure
 # display the top screen
 sub show_screen
 {
-       if ($spos >= @shistory - 1) {
+       if ($spos == @shistory - 1) {
 
                # if we really are scrolling thru at the end of the history
-               $spos = @shistory - 1 if $spos >= @shistory;
                my $line = $shistory[$spos];
                $top->addstr("\n") if $spos > 0;
                setattr($line);
@@ -189,9 +188,11 @@ sub show_screen
 # add a line to the end of the top screen
 sub addtotop
 {
-       my $inbuf = shift;
-       push @shistory, $inbuf;
-       shift @shistory if @shistory > $maxshist;
+       while (@_) {
+               my $inbuf = shift;
+               push @shistory, $inbuf;
+               shift @shistory if @shistory > $maxshist;
+       }
        show_screen();
 }