Commit 98b155c80a0e85009d92f1a61e4d963542c1798e

Daniel Stone 2012-06-04T13:01:33

Symbols: Don't include NoSymbols in the map Instead of using NoSymbol in the map, we use num_syms == 0 to signify the non-presence of a symbol. So instead of adding NoSymbol mappings to the list regardless, detect them and set num_syms == 0. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 6e7ef40..dce840b 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1071,6 +1071,11 @@ AddSymbolsToKey(KeyInfo *key, struct xkb_keymap *keymap,
                 key->symsMapNumEntries[ndx][i] = 0;
                 break;
             }
+            if (key->symsMapNumEntries[ndx][i] == 1 &&
+                key->syms[ndx][key->symsMapIndex[ndx][i] + j] == XKB_KEY_NoSymbol) {
+                key->symsMapIndex[ndx][i] = -1;
+                key->symsMapNumEntries[ndx][i] = 0;
+            }
         }
     }
     for (j = key->numLevels[ndx] - 1;