summaryrefslogtreecommitdiff
path: root/main/config.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-05-30 12:05:33 +0000
committerMatthew Jordan <mjordan@digium.com>2014-05-30 12:05:33 +0000
commite9f09ab2bce1e1aa1b619507b45d228bbc49f12c (patch)
tree7be6afed25bfeb95f54c3cc8b534422fde471b53 /main/config.c
parente039996571226f705f50d5af1a65ff8fff58da6c (diff)
main/config.c: AMI action UpdateConfig EmptyCat clears all categories
When invoking UpdateConfig AMI action with Action set to EmptyCat, Asterisk will make all categories empty in the config but the one requested with a Cat variable. This is due to a bug in ast_category_empty (main/config.c) that makes an incorrect comparison for a category name. This patch corrects the comparison such that only the requested category is cleared. Review: https://reviewboard.asterisk.org/r/3573/ #ASTERISK-23803 #close Reported by: zvision patches: manager.c.diff uploaded by zvision (License 5755) ........ Merged revisions 414880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414881 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 414882 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/config.c')
-rw-r--r--main/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/config.c b/main/config.c
index 30817be41..a3d82f4f8 100644
--- a/main/config.c
+++ b/main/config.c
@@ -1168,7 +1168,7 @@ int ast_category_empty(struct ast_config *cfg, const char *category)
struct ast_category *cat;
for (cat = cfg->root; cat; cat = cat->next) {
- if (!strcasecmp(cat->name, category))
+ if (strcasecmp(cat->name, category))
continue;
ast_variables_destroy(cat->root);
cat->root = NULL;