Entries for empty lists were ignored when rewriting the configuration file. b=133179, r=timeless

git-svn-id: svn://10.0.0.236/trunk@117829 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ian%hixie.ch 2002-04-01 01:59:24 +00:00
parent acf1b5d363
commit ee040834e3

View File

@ -89,7 +89,7 @@ sub Save {
my %seen;
foreach (@lines) {
chomp;
if (/^ *([^#;][^=\n\r]*)=(.*)$/os) {
if (/^ *([^#;][^=\n\r]*)(?:=(.*))?$/os) {
if (defined($$config{$1})) {
unless ($seen{$1}) {
my $value = $$config{$1};
@ -135,7 +135,11 @@ sub Save {
$seen{$1} = 1;
} # else seen it already
} else { # unknown
print FILE "$1=$2\n";
if (defined($2)) {
print FILE "$1=$2\n";
} else {
print FILE "$1\n";
}
}
} else {
# might be a comment