diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-05-22 10:53:48 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-05-22 10:53:48 +0000 |
commit | 31e98e3aebe9952cb5ce409c9760d2898dbc2f56 (patch) | |
tree | c93b37fcaba14c8c8b5c47c3bc8176ec825f8273 | |
parent | 7b4ec3de287166e0e7e2d4009cde7f44ccf8436b (diff) |
Do not overwrite `table' in the non-translating case.
This ensures the keyboard is using the expected scancode.
From miod@, problem also noticed by Markus Hennecke, ok otto@
-rw-r--r-- | sys/dev/pckbc/pckbd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pckbc/pckbd.c b/sys/dev/pckbc/pckbd.c index 100f28c06f5..517feee1936 100644 --- a/sys/dev/pckbc/pckbd.c +++ b/sys/dev/pckbc/pckbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbd.c,v 1.44 2018/01/06 18:51:20 jcs Exp $ */ +/* $OpenBSD: pckbd.c,v 1.45 2018/05/22 10:53:47 mpi Exp $ */ /* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -214,7 +214,7 @@ int pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, struct pckbd_internal *id) { - int table; + int table = 3; if (pckbc_xt_translation(kbctag)) { #ifdef DEBUG @@ -247,7 +247,7 @@ pckbd_set_xtscancode(pckbc_tag_t kbctag, pckbc_slot_t kbcslot, } /* keep falling back until we hit a table that looks usable. */ - for (table = 3; table >= 1; table--) { + for (; table >= 1; table--) { u_char cmd[2]; #ifdef DEBUG printf("pckbd: trying table %d\n", table); |