aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authoreliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-07 03:02:01 +0000
committereliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-07 03:02:01 +0000
commit8f78b27c8a2f390287191e25fda25f6f19fffa27 (patch)
treea07b2206ae61341b56d2d34a14590deceacd00ea /main
parentbec40ce4dce7e308d5a2d53501852756bdd6125a (diff)
If 'asterisk.conf' is not found, instead of giving up,
load documentation for the 'en_US' language (fix my last commit). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@155204 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 75134505b..13d125e59 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -6546,19 +6546,16 @@ int ast_load_documentation(void)
/* setup default XML documentation language */
snprintf(documentation_language, sizeof(documentation_language), default_documentation_language);
- if (!(cfg = ast_config_load2("asterisk.conf", "" /* core can't reload */, cnfflags))) {
- ast_log(LOG_ERROR, "No asterisk.conf? That cannot be good.\n");
- return 1;
- }
-
- for (var = ast_variable_browse(cfg, "options"); var; var = var->next) {
- if (!strcasecmp(var->name, "documentation_language")) {
- if (!ast_strlen_zero(var->value)) {
- snprintf(documentation_language, sizeof(documentation_language), "%s", var->value);
+ if ((cfg = ast_config_load2("asterisk.conf", "" /* core can't reload */, cnfflags))) {
+ for (var = ast_variable_browse(cfg, "options"); var; var = var->next) {
+ if (!strcasecmp(var->name, "documentation_language")) {
+ if (!ast_strlen_zero(var->value)) {
+ snprintf(documentation_language, sizeof(documentation_language), "%s", var->value);
+ }
}
}
+ ast_config_destroy(cfg);
}
- ast_config_destroy(cfg);
/* initialize the XML library. */
ast_xml_init();