summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-12-05 16:22:21 +0000
committerFrancois Pons <fpons@mandriva.com>2000-12-05 16:22:21 +0000
commit7f02bd3425a9d581a76ee956f9f257594999e923 (patch)
treec95877bdeb84d42fe8b09701acc47cf3e3ddc6bd
parentc9c07f9e0d2ebfb7d3644394609ef9839b1530cb (diff)
downloaddrakx-backup-do-not-use-7f02bd3425a9d581a76ee956f9f257594999e923.tar
drakx-backup-do-not-use-7f02bd3425a9d581a76ee956f9f257594999e923.tar.gz
drakx-backup-do-not-use-7f02bd3425a9d581a76ee956f9f257594999e923.tar.bz2
drakx-backup-do-not-use-7f02bd3425a9d581a76ee956f9f257594999e923.tar.xz
drakx-backup-do-not-use-7f02bd3425a9d581a76ee956f9f257594999e923.zip
final fixes to versionCompare to make sure no deadlock can occurs.
-rw-r--r--perl-install/pkgs.pm3
1 files changed, 2 insertions, 1 deletions
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;
}
}