Blob Blame Raw
http://rt.cpan.org/NoAuth/Bug.html?id=7528


diff -ru Net-IP-1.22.orig/IP.pm Net-IP-1.22/IP.pm
--- Net-IP-1.22.orig/IP.pm	2005-05-27 12:01:23.000000000 +0300
+++ Net-IP-1.22/IP.pm	2005-05-28 11:54:07.000000000 +0300
@@ -1529,10 +1529,8 @@
 	while (ip_bincomp ($binip,'le',$endbinip) == 1)
 	{
 		# Find all 0s at the end
-		$binip =~ m/(0+)$/;
-		# nbits = nb of 0 bits
-		
-		if ($1) {
+		if ($binip =~ m/(0+)$/) {
+			# nbits = nb of 0 bits
 			$nbits = length ($1);
 		}
 		else {
diff -ru Net-IP-1.22.orig/t/ipv4.t Net-IP-1.22/t/ipv4.t
--- Net-IP-1.22.orig/t/ipv4.t	2003-02-14 11:38:03.000000000 +0200
+++ Net-IP-1.22/t/ipv4.t	2005-05-28 11:56:48.000000000 +0300
@@ -12,7 +12,7 @@
 	};
 };
 
-my $numtests = 21;
+my $numtests = 23;
 
 # Create checker:
 my $T = typical ExtUtils::TBone;
@@ -60,9 +60,13 @@
 $T->ok_eqnum ($ip->bincomp('gt',$ip2),1,$ip->error());
 
 $ip = new Net::IP('133.44.255.255-133.45.0.42');
-
 $T->ok_eq (($ip->find_prefixes())[3],'133.45.0.40/31',$ip->error());
 
+$ip = new Net::IP('192.168.2.254-192.168.2.255');
+my @prefixes = $ip->find_prefixes();
+$T->ok_eqnum (scalar(@prefixes), 1);
+$T->ok_eq ($prefixes[0],'192.168.2.254/31',$ip->error());
+
 $ip->set('201.33.128.0/22');
 $ip2->set('201.33.129.0/24');