From: Wayne Davison Date: Sun, 31 Jan 2016 22:40:47 +0000 (-0800) Subject: Fix/improve the sort functions. X-Git-Tag: v3.1.3pre1~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e25abc9a90ba2287670a1e6d445a7350f6d886b;p=thirdparty%2Frsync.git Fix/improve the sort functions. Fixes bug 11704. --- diff --git a/support/rsyncstats b/support/rsyncstats index e770b9dd..ab7246d3 100755 --- a/support/rsyncstats +++ b/support/rsyncstats @@ -270,27 +270,27 @@ foreach $hour (sort keys %xfertbytes) { exit(0); sub datecompare { - $a gt $b; + $a cmp $b; } sub domnamcompare { $sdiff = length($a) - length($b); - ($sdiff < 0) ? -1 : ($sdiff > 0) ? 1 : ($a lt $b) ? -1 : ($a gt $b) ? 1 : 0; + ($sdiff < 0) ? -1 : ($sdiff > 0) ? 1 : $a cmp $b; } sub bytecompare { $bdiff = $groupbytes{$b} - $groupbytes{$a}; - ($bdiff < 0) ? -1 : ($bdiff > 0) ? 1 : ($a lt $b) ? -1 : ($a gt $b) ? 1 : 0; + ($bdiff < 0) ? -1 : ($bdiff > 0) ? 1 : $a cmp $b; } sub faccompare { $fdiff = $fac{$b} - $fac{$a}; - ($fdiff < 0) ? -1 : ($fdiff > 0) ? 1 : ($a lt $b) ? -1 : ($a gt $b) ? 1 : 0; + ($fdiff < 0) ? -1 : ($fdiff > 0) ? 1 : $a cmp $b; }