fix spurious == errors on console.pl input
authorDirk Koopman <djk@tobit.co.uk>
Sat, 11 Jul 2020 01:56:04 +0000 (02:56 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 11 Jul 2020 01:56:04 +0000 (02:56 +0100)
This only happens if it catches a character during the idle loop
which is the only way to catch Curses RESIZE signal. But a stray
"normal" character might get through as well.

perl/console.pl

index f7b0d5f4690e7b7edbefb6d3335bc540cd24d9c0..78272aace8027843347d1c5d1c27dbd9e6d37494 100755 (executable)
@@ -518,7 +518,7 @@ sub idle_loop
        }
        my $ch = $bot->getch();         # this is here just to catch RESIZE events
        if (defined $ch) {
-               if ($ch == KEY_RESIZE) {
+               if ($ch =~ /^\d+$/ && $ch == KEY_RESIZE) {
                        doresize();
                } else {
                        rec_stdin($ch) unless $ch == '-1';