When checking keyboard variants, perform a stricter comparison.

This prevents kbd(8) layouts with particular bitmasks from being
wrongly detected as French.

Broken behavior reported by Diogo Galvao; thanks!

ok mpi@ matthieu@
This commit is contained in:
bentley 2019-04-06 13:51:18 +00:00
parent 6c125d439c
commit 63a1f613db

View File

@ -139,7 +139,9 @@ wscons_add_keyboard(void)
break; break;
} }
for (i = 0; kbdvar[i].val; i++) for (i = 0; kbdvar[i].val; i++)
if ((wsenc & kbdvar[i].val) == kbdvar[i].val) { if ((wsenc & kbdvar[i].val) == kbdvar[i].val &&
(KB_ENCODING(wsenc) == KB_ENCODING(kbdvar[i].val) ||
!KB_ENCODING(kbdvar[i].val))) {
LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n", LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n",
kbdvar[i].name); kbdvar[i].name);
input_options = input_option_new(input_options, input_options = input_option_new(input_options,