AST_RWLIST_RDLOCK(&groups);
AST_RWLIST_TRAVERSE(&groups, gi, list) {
- if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+ if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
count++;
}
AST_RWLIST_UNLOCK(&groups);
AST_RWLIST_RDLOCK(&groups);
AST_RWLIST_TRAVERSE(&groups, gi, list) {
- if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+ if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
count++;
}
AST_RWLIST_UNLOCK(&groups);