From: Russell Bryant Date: Wed, 7 Jun 2006 20:02:07 +0000 (+0000) Subject: simplify the loop that iterates through the categories in followme.conf and X-Git-Tag: 1.4.0-beta1~1002 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f879fd2a22e07d0f5127ad79904b980a63ceb8e9;p=thirdparty%2Fasterisk.git simplify the loop that iterates through the categories in followme.conf and don't try to read the general section as a followme profile git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32878 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_followme.c b/apps/app_followme.c index 5b6a8f1843..d0a8d3c082 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -279,7 +279,7 @@ static int reload_followme(void) { struct ast_call_followme *f; struct ast_config *cfg; - char *cat, *tmp; + char *cat = NULL, *tmp; struct ast_variable *var; struct number *cur, *nm; int new, idx; @@ -346,8 +346,9 @@ static int reload_followme(void) ast_copy_string(sorryprompt, tmpstr, sizeof(sorryprompt)); /* Chug through config file */ - cat = ast_category_browse(cfg, NULL); - while(cat) { + while ((cat = ast_category_browse(cfg, cat))) { + if (!strcasecmp(cat, "general")) + continue; /* Define a new profile */ /* Look for an existing one */ AST_LIST_TRAVERSE(&followmes, f, entry) { @@ -416,7 +417,6 @@ static int reload_followme(void) AST_LIST_INSERT_HEAD(&followmes, f, entry); } } - cat = ast_category_browse(cfg, cat); } ast_config_destroy(cfg);