Open-code a radio group SimpleLookup Because, joke's on you, it wasn't actually looking up radio groups. Just checking to see if it was a string that was "none", or an integer. Lord give me strength. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 08b9bd7..0b225cc 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1100,11 +1100,6 @@ static LookupEntry repeatEntries[] = {
{NULL, 0}
};
-static LookupEntry rgEntries[] = {
- {"none", 0},
- {NULL, 0}
-};
-
static Bool
SetSymbolsField(KeyInfo * key,
struct xkb_desc * xkb,
@@ -1189,12 +1184,19 @@ SetSymbolsField(KeyInfo * key,
Bool permanent = False;
if (uStrCaseCmp(field, "permanentradiogroup") == 0)
permanent = True;
- ok = ExprResolveInteger(value, &tmp, SimpleLookup,
- (char *) rgEntries);
+ if (ExprResolveString(value, &tmp)) {
+ ok = (strcmp(tmp.str, "none") == 0);
+ free(tmp.str);
+ if (ok)
+ tmp.uval = 0;
+ }
+ else {
+ ok = ExprResolveInteger(value, &tmp, NULL, 0);
+ }
if (!ok)
{
ERROR("Illegal radio group specification for %s\n",
- longText(key->name));
+ longText(key->name));
ACTION("Non-integer radio group ignored\n");
return False;
}