There are a lot of existing systems that #include non-existent files. So, to

make the transition to treating this as an error a bit less painless, just issue
a huge error message for now.  Then, later, we can reinstate the code that treats
it as a failure.

(Thanks to philippel for the feedback)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-12-14 17:36:08 +00:00
parent 6a2c388e18
commit 4965b39719

View File

@@ -744,8 +744,17 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
do_include = ast_config_internal_load(cur, cfg, withcomments) ? 1 : 0;
if(!ast_strlen_zero(exec_file))
unlink(exec_file);
if(!do_include)
return -1;
if (!do_include) {
ast_log(LOG_ERROR, "*********************************************************\n");
ast_log(LOG_ERROR, "*********** YOU SHOULD REALLY READ THIS ERROR ***********\n");
ast_log(LOG_ERROR, "Future versions of Asterisk will treat a #include of a "
"file that does not exist as an error, and will fail to "
"load that configuration file. Please ensure that the "
"file '%s' exists, even if it is empty.\n", cur);
ast_log(LOG_ERROR, "*********** YOU SHOULD REALLY READ THIS ERROR ***********\n");
ast_log(LOG_ERROR, "*********************************************************\n");
return 0;
}
} else {
ast_log(LOG_WARNING, "Directive '#%s' needs an argument (%s) at line %d of %s\n",