aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rpmtools.pm')
-rw-r--r--rpmtools.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmtools.pm b/rpmtools.pm
index 5b08d32..98b9895 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -582,7 +582,7 @@ sub version_compare {
while ($a || $b) {
my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D*)// } ($b, $a);
- $_ = length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0;
+ $_ = ($sa =~ /^\d/ || $sb =~ /^\d/) && length($sa) <=> length($sb) || $sa cmp $sb and return $_ || 0;
$sa eq '' && $sb eq '' and return $a cmp $b || 0;
}
0;