summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-02-26 13:37:53 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-02-26 13:37:53 +0000
commitd735c7fa10dc6b4f7b42ad89a1366411aff52999 (patch)
treeab9500038847bdf2b89ebc6cf22ca2c2b01ffa8b
parent8363108e46c198448ca7faaa3153b252e48bcb64 (diff)
downloadmailutils-d735c7fa10dc6b4f7b42ad89a1366411aff52999.tar.gz
mailutils-d735c7fa10dc6b4f7b42ad89a1366411aff52999.tar.bz2
Fix error reporting.
-rw-r--r--libcfg/init.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/libcfg/init.c b/libcfg/init.c
index 3aff6e316..a4772b43d 100644
--- a/libcfg/init.c
+++ b/libcfg/init.c
@@ -87,15 +87,23 @@ int
mu_parse_config_files (struct mu_cfg_param *param, void *target)
{
int flags = 0;
-
+ int rc;
+
if (mu_cfg_parser_verbose)
flags |= MU_PARSE_CONFIG_VERBOSE;
if (mu_cfg_parser_verbose > 1)
flags |= MU_PARSE_CONFIG_DUMP;
if (mu_load_site_rcfile)
- mu_parse_config (MU_CONFIG_FILE, mu_program_name, param,
- flags | MU_PARSE_CONFIG_GLOBAL, target);
+ {
+ rc = mu_parse_config (MU_CONFIG_FILE, mu_program_name, param,
+ flags | MU_PARSE_CONFIG_GLOBAL, target);
+ if (rc == ENOMEM)
+ {
+ mu_error ("%s", mu_strerror (rc));
+ return rc;
+ }
+ }
if (mu_load_user_rcfile && mu_program_name)
{
@@ -106,14 +114,29 @@ mu_parse_config_files (struct mu_cfg_param *param, void *target)
strcpy (file_name, "~/.");
strcat (file_name, mu_program_name);
- mu_parse_config (file_name, mu_program_name, param, flags, target);
+ rc = mu_parse_config (file_name, mu_program_name, param, flags,
+ target);
+ if (rc == ENOMEM)
+ {
+ mu_error ("%s", mu_strerror (rc));
+ return rc;
+ }
free (file_name);
}
}
if (mu_load_rcfile)
- mu_parse_config (mu_load_rcfile, mu_program_name, param, flags, target);
-
+ {
+ rc = mu_parse_config (mu_load_rcfile, mu_program_name, param,
+ flags, target);
+ if (rc)
+ {
+ mu_error (_("Cannot open file %s: %s"), mu_load_rcfile,
+ mu_strerror (rc));
+ return rc;
+ }
+ }
+
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.