aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rwxr-xr-xconfig.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/config.c b/config.c
index 138e28f1d..846802e80 100755
--- a/config.c
+++ b/config.c
@@ -150,12 +150,15 @@ char *ast_variable_retrieve(const struct ast_config *config, const char *categor
struct ast_variable *v;
if (category) {
- for (v = ast_variable_browse(config, category); v; v = v->next)
+ char *val = NULL;
+ for (v = ast_variable_browse(config, category); v; v = v->next) {
if (variable == v->name)
return v->value;
- for (v = ast_variable_browse(config, category); v; v = v->next)
if (!strcasecmp(variable, v->name))
- return v->value;
+ val = v->value;
+ }
+ if (val)
+ return val;
} else {
struct ast_category *cat;