[PATCH] xkb: don't replicate past the number of groups we have.

Peter Hutterer peter.hutterer at who-t.net
Mon Dec 1 22:45:22 PST 2008


From: Peter Hutterer <peter.hutterer at redhat.com>

---
 xkb/xkbUtils.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 313d418..014ddef 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -524,7 +524,7 @@ int			maxNumberOfGroups;
 	     */
 	    if (nGroups == 1)
 	    {
-		int idx;
+		int idx, j;
 
 		groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index);
 
@@ -547,8 +547,9 @@ int			maxNumberOfGroups;
 		if (idx < 4)
 		    idx = 4;
 		/* 3 or more groups: ABABCDECDEABCDEABCDE */
-		for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++)
-		    pCore[idx++] = pXKB[n];
+                for (j = 3; j <= maxNumberOfGroups; j++)
+                    for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++)
+                        pCore[idx++] = pXKB[n];
 	    }
 
 	    pXKB+= XkbKeyGroupsWidth(xkb,key);
-- 
1.6.0.4




More information about the xorg mailing list