Fix a problem with tests of the form "1.0" vs. "1.0a".

MFC candidate.

Pointed out by:		knu
This commit is contained in:
Bruce A. Mah 2001-04-19 22:17:07 +00:00
parent 51be6918b5
commit a4d6eeb369
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75715
2 changed files with 15 additions and 3 deletions

View file

@ -148,7 +148,18 @@ sub CompareNumbers {
else {
$c1 =~ s/\d+//;
$c2 =~ s/\d+//;
return &CompareNumbers($c1, $c2);
if ($c1 eq $c2) {
return 0;
}
elsif ($c1 eq "") {
return -1;
}
elsif ($c2 eq "") {
return 1;
}
else {
return &CompareNumbers($c1, $c2);
}
}
}
}

View file

@ -61,8 +61,9 @@ test-pv 0.9 "<" 0.10 inequality
test-pv 2.3p10 ">" 2.3p9 number/letter
test-pv 1.6.0 ">" 1.6.0.p3 number/letter
test-pv 1.0.b ">" 1.0.a3 number/letter
test-pv 1.0a "<" 1.0 number/letter
test-pv 5.0a "<" 5.0.b number/letter
test-pv 1.0a ">" 1.0 number/letter
test-pv 1.0a "<" 1.0b number/letter
test-pv 5.0a ">" 5.0.b number/letter
test-pv 1.5_1 ">" 1.5 portrevision
test-pv 1.5_2 ">" 1.5_1 portrevision