Better splitting regexp for test_ordinals
Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
2ab9687479
commit
ea09088e17
@ -73,28 +73,28 @@ sub testordinals
|
|||||||
|
|
||||||
open(my $fh, '<', $filename);
|
open(my $fh, '<', $filename);
|
||||||
while (my $line = <$fh>) {
|
while (my $line = <$fh>) {
|
||||||
my @tokens = split(/( |\t|:)+/, $line);
|
my @tokens = split(/(?:\s+|\s*:\s*)/, $line);
|
||||||
#Check the line looks sane
|
#Check the line looks sane
|
||||||
if ($#tokens < 8 || $#tokens > 10) {
|
if ($#tokens < 4 || $#tokens > 5) {
|
||||||
print STDERR "Invalid line:\n$line\n";
|
print STDERR "Invalid line:\n$line\n";
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
if ($tokens[4] eq "NOEXIST") {
|
if ($tokens[2] eq "NOEXIST") {
|
||||||
#Ignore this line
|
#Ignore this line
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
#Some ordinals can be repeated, e.g. if one is VMS and another is !VMS
|
#Some ordinals can be repeated, e.g. if one is VMS and another is !VMS
|
||||||
$newqual = $tokens[6];
|
$newqual = $tokens[3];
|
||||||
$newqual =~ s/!//g;
|
$newqual =~ s/!//g;
|
||||||
if ($cnt > $tokens[2]
|
if ($cnt > $tokens[1]
|
||||||
|| ($cnt == $tokens[2] && ($qualifier ne $newqual
|
|| ($cnt == $tokens[1] && ($qualifier ne $newqual
|
||||||
|| $qualifier eq "FUNCTION"))) {
|
|| $qualifier eq "FUNCTION"))) {
|
||||||
print STDERR "Invalid ordinal detected: ".$tokens[2]."\n";
|
print STDERR "Invalid ordinal detected: ".$tokens[1]."\n";
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
$cnt = $tokens[2];
|
$cnt = $tokens[1];
|
||||||
$qualifier = $newqual;
|
$qualifier = $newqual;
|
||||||
$lastfunc = $tokens[0];
|
$lastfunc = $tokens[0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user