From: Ran Benita Date: Sat, 19 May 2012 09:50:47 +0000 (+0300) Subject: rules: allow wildcard match against "" layout/varaint X-Git-Tag: accepted/2.0alpha-wayland/20121109.204519~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68edd5f0df85c0bce5368c9c7aa52be219e50011;p=profile%2Fivi%2Flibxkbcommon.git rules: allow wildcard match against "" layout/varaint Currently, if you pass in an rmlvo with an empty string for layout or variant, it would not match layout and variant rules even with wildcards. But if the rules file had set an appropriate default, and someone passes in the empty string, than he should get the default. NULL in this case signifies not wanting to match against the layout or variant at all, and so the rule should still fail to match NULLs. Signed-off-by: Ran Benita --- diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index 90e70b6..16cb085 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -788,8 +788,7 @@ apply_rule_if_matches(struct rules *rules, struct rule *rule, } if (rule->layout) { - if (mdefs->layout[rule->layout_num] == NULL || - *mdefs->layout[rule->layout_num] == '\0') + if (mdefs->layout[rule->layout_num] == NULL) return 0; if (strcmp(rule->layout, "*") == 0) { @@ -807,8 +806,7 @@ apply_rule_if_matches(struct rules *rules, struct rule *rule, } if (rule->variant) { - if (mdefs->variant[rule->variant_num] == NULL || - *mdefs->variant[rule->variant_num] == '\0') + if (mdefs->variant[rule->variant_num] == NULL) return 0; if (strcmp(rule->variant, "*") == 0) {