Commit b6c79ad0d82fddfa0c020e73337b4c92a72d9781

Daniel Stone 2012-03-22T14:32:23

LEDs: Fix string comparison bug This resulted in duplicate sets of modifiers, since we were comparing pointer equality of two strings, rather than string equality. Oops. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index d1ecc75..55328c2 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -450,7 +450,9 @@ BindIndicators(struct xkb_desc * xkb, Bool force, LEDInfo *unbound,
             {
                 for (i = 0; i < XkbNumIndicators; i++)
                 {
-                    if (xkb->names->indicators[i] == XkbcAtomText(led->name))
+                    if (xkb->names->indicators[i] &&
+                        strcmp(xkb->names->indicators[i],
+                               XkbcAtomText(led->name)) == 0)
                     {
                         led->indicator = i + 1;
                         break;