From 7f02bd3425a9d581a76ee956f9f257594999e923 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 5 Dec 2000 16:22:21 +0000 Subject: final fixes to versionCompare to make sure no deadlock can occurs. --- perl-install/pkgs.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 4533f1808..8e5e62afd 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -836,8 +836,9 @@ sub versionCompare($$) { local $_; while ($a || $b) { - my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D+)// } ($b, $a); + my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D*)// } ($b, $a); $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_; + $sa eq '' && $sb eq '' and return $a cmp $b; } } -- cgit v1.2.1