So far this hasn't caused problems, because parent events had been using
parent categories. However, if the parent category wasn't used by an event
or its parents, an event filter wouldn't have matched it.
return TRUE;
}
+static bool
+event_category_match(const struct event_category *category,
+ const struct event_category *wanted_category)
+{
+ for (; category != NULL; category = category->parent) {
+ if (category == wanted_category)
+ return TRUE;
+ }
+ return FALSE;
+}
+
static bool
event_has_category(struct event *event, struct event_category *wanted_category)
{
while (event != NULL) {
if (array_is_created(&event->categories)) {
array_foreach(&event->categories, catp) {
- if (*catp == wanted_category)
+ if (event_category_match(*catp, wanted_category))
return TRUE;
}
}