if (!ParseIncludeMap(&tmp, &file, &map, &nextop, &extra_data))
goto err;
+ /*
+ * Given an RMLVO (here layout) like 'us,,fr', the rules parser
+ * will give out something like 'pc+us+:2+fr:3+inet(evdev)'.
+ * We should just skip the ':2' in this case and leave it to the
+ * appropriate section to deal with the empty group.
+ */
+ if (isempty(file)) {
+ free(file);
+ free(map);
+ free(extra_data);
+ continue;
+ }
+
if (first == NULL) {
first = incl = malloc(sizeof(*first));
} else {
/* 20 is not a legal group; make sure this is handled gracefully. */
assert(test_rmlvo(ctx, "evdev", "", "us:20", "", ""));
+ /* Don't choke on missing values in RMLVO. Should just skip them. */
+ assert(test_rmlvo(ctx, "evdev", "", "us,,ca", "", ""));
+
assert(test_rmlvo(ctx, "", "", "", "", ""));
assert(test_rmlvo(ctx, NULL, NULL, NULL, NULL, NULL));