diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-31 13:30:24 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-31 13:30:24 +0000 |
commit | a18dcc6a1374f46fbb621683daa3956572bcc1aa (patch) | |
tree | 1aab12c13b51067748ee7fc06a87f137bebc8ee6 /rpmdrake.pm | |
parent | 08799daa089f24812a4aaaa9208fca8abe823f3a (diff) | |
download | rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.gz rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.bz2 rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.tar.xz rpmdrake-a18dcc6a1374f46fbb621683daa3956572bcc1aa.zip |
(readconf) prevent crash by ignoring undefined values (crash hapenned
if config file set empty values for some variables (eg: after old
gurpmi.addmedia garbaged it)) (#39511)
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r-- | rpmdrake.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm index 4e2a3482..da4a8570 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -169,6 +169,9 @@ sub readconf() { ${$config{$_}{var}} = $config{$_}{default} foreach keys %config; foreach my $l (cat_($configfile)) { $l =~ /^\Q$_\E (.*)/ and ${$config{$_}{var}} = [ split ' ', $1 ] foreach keys %config; + foreach (keys %config) { + $l =~ /^\Q$_\E (.*)/ and $1 and ${$config{$_}{var}} = [ split ' ', $1 ]; + } } # special cases: $::rpmdrake_options{'no-confirmation'} = $no_confirmation->[0] if !defined $::rpmdrake_options{'no-confirmation'}; |