From 20a64d03d8f3799f5c2b761298ee332e153ebf52 Mon Sep 17 00:00:00 2001 From: Reza Snowdon Date: Mon, 29 Nov 2010 15:24:48 +0100 Subject: [PATCH] Exit immediately if the system config file cannot be parsed. --- src/ChangeLog | 6 ++++++ src/init.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index d9000556..5e5843f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-11-27 Reza Snowdon + + * init.c (initialize): If 'ok' is not zero; exit, as + this indicates there was a problem parsing 'SYSTEM_WGETRC'. + Fixes bug #20370 + 2010-11-22 Giuseppe Scrivano Revert last commit. diff --git a/src/init.c b/src/init.c index ffdaa6d6..5559369d 100644 --- a/src/init.c +++ b/src/init.c @@ -588,6 +588,15 @@ initialize (void) else if (file_exists_p (SYSTEM_WGETRC)) ok &= run_wgetrc (SYSTEM_WGETRC); #endif + /* If there are any problems parsing the system wgetrc file, tell + the user and exit */ + if (! ok) + { + fprintf (stderr, _("\ +Parsing system wgetrc file failed, please check '%s'. \ +Or specify a different file using --config\n"), SYSTEM_WGETRC); + exit (2); + } /* Override it with your own, if one exists. */ file = wgetrc_file_name (); if (!file) -- 2.39.2