diff --git a/main/config.c b/main/config.c index 2055af396e..a382a7a809 100644 --- a/main/config.c +++ b/main/config.c @@ -2050,9 +2050,9 @@ struct ast_config *ast_config_internal_load(const char *filename, struct ast_con result = loader->load_func(db, table, filename, cfg, flags, suggested_include_file, who_asked); - if (result && result != CONFIG_STATUS_FILEUNCHANGED) + if (result && result != CONFIG_STATUS_FILEINVALID && result != CONFIG_STATUS_FILEUNCHANGED) result->include_level--; - else + else if (result != CONFIG_STATUS_FILEINVALID) cfg->include_level--; return result; diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 798a098bbe..2899ec1a71 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1412,7 +1412,7 @@ static int pbx_load_config(const char *config_file) struct ast_flags config_flags = { 0 }; char lastextension[256]; cfg = ast_config_load(config_file, config_flags); - if (!cfg) + if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) return 0; /* Use existing config to populate the PBX table */