diff options
author | Joshua Colp <jcolp@digium.com> | 2007-06-13 18:18:51 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-06-13 18:18:51 +0000 |
commit | c4c732578fc3cc7c0e361896434b24f1f94d3f94 (patch) | |
tree | e7c68a49b4fa3f7968232fb7dcfcdadccad005ab | |
parent | f25db8cc783c5f3a809f3ea72d0d4ba64d62b40a (diff) |
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)
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/app.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/main/app.c b/main/app.c index 5e12ede28..defc0081f 100644 --- a/main/app.c +++ b/main/app.c @@ -875,12 +875,16 @@ int ast_app_group_set_channel(struct ast_channel *chan, const char *data) 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); |