rules: fix check for appending '|' character when applying
authorRan Benita <ran234@gmail.com>
Wed, 29 Aug 2012 09:10:28 +0000 (12:10 +0300)
committerRan Benita <ran234@gmail.com>
Mon, 3 Sep 2012 07:31:12 +0000 (10:31 +0300)
There are two ways to separate multiple files in XKB include statements:
'+' will cause the later file to override the first in case of conflict,
while '|' will cause it augment it (this is done by xkbcomp). '!' is
unrelated here.
Since '|' is practically never used, this wasn't noticed.

In the modified test, the '|some_compat' previously was just ignored.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/rules.c
test/data/rules/simple
test/rules-file.c

index a1a0da1..bd99dc1 100644 (file)
@@ -629,7 +629,7 @@ apply(const char *src, char **dst)
     if (!src)
         return;
 
-    if (*src == '+' || *src == '!') {
+    if (*src == '+' || *src == '|') {
         tmp = *dst;
         ret = asprintf(dst, "%s%s", *dst, src);
         if (ret < 0)
index 16fc495..446954e 100644 (file)
@@ -18,4 +18,4 @@
   *             = default_compat
 
 ! option        = compat
-  my_option     = +some:compat
+  my_option     = |some:compat
index ee53f09..67a000e 100644 (file)
@@ -110,7 +110,7 @@ main(void)
         .options = "my_option",
 
         .keycodes = "my_keycodes", .types = "my_types",
-        .compat = "my_compat+some:compat",
+        .compat = "my_compat|some:compat",
         .symbols = "my_symbols+extra_variant",
     };
     assert(test_rules(ctx, &test1));