The following commit has been merged in the master branch:
commit 954de84bea0565584a36cd7cc2bafe7fb23d0cce
Author: Guillem Jover <[email protected]>
Date:   Wed Apr 17 03:54:46 2013 +0200

    dselect: Use looks_like_number() instead of coercion to number

diff --git a/dselect/mkcurkeys.pl b/dselect/mkcurkeys.pl
index 337b940..75f47bc 100755
--- a/dselect/mkcurkeys.pl
+++ b/dselect/mkcurkeys.pl
@@ -18,6 +18,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+use Scalar::Util qw(looks_like_number);
+
 $#ARGV == 1 || die ("usage: mkcurkeys.pl <filename> <curses.h>");
 
 open(OV,"<$ARGV[0]") || die $!;
@@ -75,9 +77,9 @@ for ($i=33; $i<=126; $i++) {
 }
 
 for $k (sort {
-    $a+0 eq $a ?
-        $b+0 eq $b ? $a <=> $b : -1
-            : $b+0 eq $b ? 1 :
+    looks_like_number($a) ?
+        looks_like_number($b) ? $a <=> $b : -1
+            : looks_like_number($b) ? 1 :
                 $a cmp $b
                 } keys %base) {
     $v= $base{$k};

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to