Fail if the config file cannot be sensibly parsed as an keyfile.

git-svn-id: http://emdebian.org/svn/current@7703 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2010-12-25 10:57:04 +00:00
parent b07ecbf9f7
commit d605cd7ccb

View file

@ -829,7 +829,10 @@ will be created - it is not packed into a .tgz once complete.
sub cascade { sub cascade {
$file = shift; $file = shift;
$config = Config::Auto::parse($file); $config = Config::Auto::parse($file, format => 'ini');
if (not defined $config or (scalar keys %$config) == 0) {
die ("$progname: ". _g("Failed to parse '$file'!\n"));
}
foreach $key (%$config) { foreach $key (%$config) {
$type = lc($key) if (ref $key ne "HASH"); $type = lc($key) if (ref $key ne "HASH");
$value = $key if (ref $key eq "HASH"); $value = $key if (ref $key eq "HASH");