os: let empty label prefix/suffix match

This patch changes the 'Xml_node_label_score' to regard an empty
label_prefix or label_suffix as a match instead of a conflict. Until
now, there was no use case for an empty label_prefix. But with init's
new ability to route environment sessions, an empty prefix denotes any
child-initiated session (as oposed to an parent-initiated environment
session).

Issue #2215
Issue #2233
This commit is contained in:
Norman Feske 2017-01-19 17:37:13 +01:00 committed by Christian Helmuth
parent 9006b7ea6a
commit c1e399025e

View File

@ -64,7 +64,7 @@ struct Genode::Xml_node_label_score
Prefix const prefix = node.attribute_value("label_prefix", Prefix());
if (!strcmp(label.string(), prefix.string(), prefix.length() - 1))
prefix_match = prefix.length()-1;
prefix_match = prefix.length();
}
if (suffix_present) {
@ -75,7 +75,7 @@ struct Genode::Xml_node_label_score
unsigned const offset = label.length() - suffix.length();
if (!strcmp(label.string() + offset, suffix.string()))
suffix_match = suffix.length()-1;
suffix_match = suffix.length();
}
}
}