Index: config.c =================================================================== RCS file: /usr/cvsroot/asterisk/config.c,v retrieving revision 1.62 diff -u -r1.62 config.c --- config.c 8 May 2005 17:31:09 -0000 1.62 +++ config.c 10 May 2005 00:24:24 -0000 @@ -554,6 +554,7 @@ int lineno=0; int comment = 0, nest[MAX_NESTED_COMMENTS]; struct ast_category *cat = NULL; + int count = 0; cat = ast_config_get_current_category(cfg); @@ -590,6 +591,7 @@ fflush(stdout); } if ((f = fopen(fn, "r"))) { + count++; if (option_debug) ast_log(LOG_DEBUG, "Parsing %s\n", fn); else if (option_verbose > 1) @@ -672,6 +674,8 @@ } } #endif + if (count == 0) + return NULL; return cfg; } @@ -791,17 +795,19 @@ void read_config_maps(void) { - struct ast_config *config; + struct ast_config *config, *configtmp; struct ast_variable *v; char *driver, *table, *database, *stringp; clear_config_maps(); - config = ast_config_new(); - config->max_include_level = 1; - config = ast_config_internal_load(extconfig_conf, config); - if (!config) + configtmp = ast_config_new(); + configtmp->max_include_level = 1; + config = ast_config_internal_load(extconfig_conf, configtmp); + if (!config) { + ast_config_destroy(configtmp); return; + } for (v = ast_variable_browse(config, "settings"); v; v = v->next) { stringp = v->value;