[asterisk-commits] file: branch 1.2 r69127 - /branches/1.2/app.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jun 13 11:12:49 MST 2007


Author: file
Date: Wed Jun 13 13:12:48 2007
New Revision: 69127

URL: http://svn.digium.com/view/asterisk?view=rev&rev=69127
Log:
Return group counting to previous behavior where you could only have one group per category. (issue #9711 reported by irroot)

Modified:
    branches/1.2/app.c

Modified: branches/1.2/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/app.c?view=diff&rev=69127&r1=69126&r2=69127
==============================================================================
--- branches/1.2/app.c (original)
+++ branches/1.2/app.c Wed Jun 13 13:12:48 2007
@@ -1047,12 +1047,16 @@
 		len += strlen(category) + 1;
 
 	AST_LIST_LOCK(&groups);
-	AST_LIST_TRAVERSE(&groups, gi, list) {
-		if (gi->chan == chan && !strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category))))
-			break;
-	}
-
-	if (!gi && (gi = calloc(1, len))) {
+	AST_LIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
+		if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) {
+			AST_LIST_REMOVE_CURRENT(&groups, list);
+			free(gi);
+			break;
+		}
+	}
+	AST_LIST_TRAVERSE_SAFE_END
+
+	if ((gi = calloc(1, len))) {
 		gi->chan = chan;
 		gi->group = (char *) gi + sizeof(*gi);
 		strcpy(gi->group, group);



More information about the asterisk-commits mailing list