Fix bad date format error introduced with the %M variable.

This commit is contained in:
Darold 2012-12-01 11:38:26 +01:00
parent ce0b1caf02
commit 2e14da8bc9
1 changed files with 3 additions and 3 deletions

View File

@ -2868,7 +2868,7 @@ sub parse_config
while (my $l = <CONF>) {
chomp($l);
next if (!$l || ($l =~ /^[\s\t]*#/));
my ($key, $val) = split(/[\s\t]+/, $l);
my ($key, $val) = split(/[\s\t]+/, $l, 2);
$opt{$key} = $val;
}
close(CONF);
@ -2883,8 +2883,8 @@ sub parse_config
exit 0;
}
if (exists $opt{DateFormat}) {
if ( ($opt{DateFormat} !~ m#\%y#) || ($opt{DateFormat} !~ m#\%m#) || ($opt{DateFormat} !~ m#\%d#) ) {
print STDERR "Error: bad date format, must have \%y, \%m, \%d. See option: DateFormat\n";
if ( ($opt{DateFormat} !~ m#\%y#) || (($opt{DateFormat} !~ m#\%m#) && ($opt{DateFormat} !~ m#\%M#) )|| ($opt{DateFormat} !~ m#\%d#) ) {
print STDERR "Error: bad date format: $opt{DateFormat}, must have \%y, \%m or \%M, \%d. See DateFormat option.\n";
exit 0;
}
}