[asterisk-commits] file: trunk r69129 - in /trunk: ./ main/app.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jun 13 11:18:52 MST 2007


Author: file
Date: Wed Jun 13 13:18:51 2007
New Revision: 69129

URL: http://svn.digium.com/view/asterisk?view=rev&rev=69129
Log:
Merged revisions 69128 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r69128 | file | 2007-06-13 14:16:00 -0400 (Wed, 13 Jun 2007) | 10 lines

Merged revisions 69127 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69127 | file | 2007-06-13 14:12:48 -0400 (Wed, 13 Jun 2007) | 2 lines

Return group counting to previous behavior where you could only have one group per category. (issue #9711 reported by irroot)

........

................

Modified:
    trunk/   (props changed)
    trunk/main/app.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/app.c
URL: http://svn.digium.com/view/asterisk/trunk/main/app.c?view=diff&rev=69129&r1=69128&r2=69129
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Wed Jun 13 13:18:51 2007
@@ -875,12 +875,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))))
+	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;
-	}
-	
-	if (!gi && (gi = ast_calloc(1, len))) {
+		}
+	}
+	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