fix uninit line in console
[spider.git] / perl / console.pl
index 8a1c8719f8b7f24d1423c26f328c154c242e6714..a0e4f1087a676825397a46a0e2a0fb8cb19b9ff2 100755 (executable)
@@ -137,9 +137,10 @@ 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);
@@ -426,7 +427,7 @@ Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin);
 
 for (;;) {
        my $t;
-       Msg->event_loop(1, 0.010);
+       Msg->event_loop(1, 1);
        $top->refresh() if $top->is_wintouched;
        $bot->refresh();
        $t = time;