[7/7] winex11.drv: Correct the count of characters matching with layout.

Ken Thomases ken at codeweavers.com
Fri Nov 17 14:47:31 CST 2006


When there's a mismatch, it was setting ok to 0 but then incrementing i once
more before exiting the for loop.  Correcting this count is necessary to
allow the new second pass loop to ever take effect.  Otherwise, every
non-matching keycode is mapped to the first entry in the layout table.
---
  dlls/winex11.drv/keyboard.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index bca2c21..fd85b56 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1651,6 +1651,7 @@ #endif
 	      for (keyn=0; keyn<MAIN_LEN; keyn++) {
 		for (ok=(*lkey)[keyn][i=0]; ok&&(i<4); i++)
 		  if ((*lkey)[keyn][i] && (*lkey)[keyn][i]!=ckey[i]) ok=0;
+		if (!ok) i--; /* we overshot */
 		if (ok||(i>maxlen)) {
 		  maxlen=i; maxval=keyn;
 		}


More information about the wine-patches mailing list