conspy: fix ESC key lost
authorPascal Bellard <pascal.bellard@ads-lu.com>
Mon, 11 Apr 2011 01:52:53 +0000 (03:52 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 11 Apr 2011 01:52:53 +0000 (03:52 +0200)
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/conspy.c

index 9c5405332c2e276d1ca475c303c44bc26e30d670..90ef91c5c81ca6a3fce0b4fa6fdfd1567dbc1d51 100644 (file)
@@ -504,16 +504,17 @@ int conspy_main(int argc UNUSED_PARAM, char **argv)
                        }
                }
                poll_timeout_ms = 250;
+               if (option_mask32 & FLAG(v)) continue;
 
                // Insert all keys pressed into the virtual console's input
                // buffer.  Don't do this if the virtual console is in scan
                // code mode - giving ASCII characters to a program expecting
                // scan codes will confuse it.
-               if (!(option_mask32 & FLAG(v)) && G.escape_count == 0) {
+               G.key_count += bytes_read;
+               if (G.escape_count == 0) {
                        int handle, result;
                        long kbd_mode;
 
-                       G.key_count += bytes_read;
                        handle = xopen(tty_name, O_WRONLY);
                        result = ioctl(handle, KDGKBMODE, &kbd_mode);
                        if (result >= 0) {