Change 33974 by [EMAIL PROTECTED] on 2008/06/01 10:44:18

        Subject: [PATCH] Thread::Queue 2.09
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Date: Fri, 30 May 2008 12:41:41 -0400
        Message-ID: <[EMAIL PROTECTED]>
        
        Explicitly check for undef in args because some versions of
        looks_like_number(undef) return true.

Affected files ...

... //depot/perl/lib/Thread/Queue.pm#8 edit

Differences ...

==== //depot/perl/lib/Thread/Queue.pm#8 (text) ====
Index: perl/lib/Thread/Queue.pm
--- perl/lib/Thread/Queue.pm#7~33847~   2008-05-17 20:35:03.000000000 -0700
+++ perl/lib/Thread/Queue.pm    2008-06-01 03:44:18.000000000 -0700
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '2.08';
+our $VERSION = '2.09';
 
 use threads::shared 1.21;
 use Scalar::Util 1.10 qw(looks_like_number blessed reftype refaddr);
@@ -168,7 +168,10 @@
 $validate_index = sub {
     my $index = shift;
 
-    if (! looks_like_number($index) || (int($index) != $index)) {
+    if (! defined($index) ||
+        ! looks_like_number($index) ||
+        (int($index) != $index))
+    {
         require Carp;
         my ($method) = (caller(1))[3];
         $method =~ s/Thread::Queue:://;
@@ -183,7 +186,11 @@
 $validate_count = sub {
     my $count = shift;
 
-    if ((! looks_like_number($count)) || (int($count) != $count) || ($count < 
1)) {
+    if (! defined($count) ||
+        ! looks_like_number($count) ||
+        (int($count) != $count) ||
+        ($count < 1))
+    {
         require Carp;
         my ($method) = (caller(1))[3];
         $method =~ s/Thread::Queue:://;
@@ -202,7 +209,7 @@
 
 =head1 VERSION
 
-This document describes Thread::Queue version 2.08
+This document describes Thread::Queue version 2.09
 
 =head1 SYNOPSIS
 
@@ -455,7 +462,7 @@
 L<http://www.cpanforum.com/dist/Thread-Queue>
 
 Annotated POD for Thread::Queue:
-L<http://annocpan.org/~JDHEDDEN/Thread-Queue-2.08/lib/Thread/Queue.pm>
+L<http://annocpan.org/~JDHEDDEN/Thread-Queue-2.09/lib/Thread/Queue.pm>
 
 Source repository:
 L<http://code.google.com/p/thread-queue/>
End of Patch.

Reply via email to