improve regular expression to parse Jerusalem timezone files
The previous regular expression failed to parse 32 timezone files including Jersusalem. All timezone files are parsed(hopefully correctly) by this regular expression. fs-4762 paritally address.
This commit is contained in:
parent
221af936d8
commit
139b032045
|
@ -55,16 +55,13 @@ foreach my $name ( sort( keys(%name_to_file) ) ) {
|
||||||
my $data = join( "", <$in> );
|
my $data = join( "", <$in> );
|
||||||
close($in);
|
close($in);
|
||||||
|
|
||||||
if ( $data !~ /^TZif/o ) {
|
my @strings = $data =~ (m/[ -~]{4,}/g);
|
||||||
|
if ( shift(@strings) !~ /^TZif/o ) {
|
||||||
$debug && print "Skipped $file\n";
|
$debug && print "Skipped $file\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $tmp = $data;
|
$zones{$name} = pop(@strings);
|
||||||
$tmp =~ s/\n$//s;
|
|
||||||
$tmp =~ s/.*\n//sgmo;
|
|
||||||
|
|
||||||
$zones{$name} = $tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open( my $out, ">$output" );
|
open( my $out, ">$output" );
|
||||||
|
|
Loading…
Reference in New Issue