Merged revisions 74265 via svnmerge from
[asterisk/asterisk.git] / main / app.c
index 53c0d1f..52536ab 100644 (file)
@@ -908,7 +908,7 @@ int ast_app_group_get_count(const char *group, const char *category)
        
        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);
@@ -931,7 +931,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category)
 
        AST_RWLIST_RDLOCK(&groups);
        AST_RWLIST_TRAVERSE(&groups, gi, list) {
-               if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category)))
+               if (!regexec(&regexbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
                        count++;
        }
        AST_RWLIST_UNLOCK(&groups);