diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-05-18 21:35:23 +0100 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-06-09 12:17:10 +0100 |
commit | ebf49c8bdb450d0923b895d19bea932bba5fb40c (patch) | |
tree | 84320bbebb3c6f1e32c92bfd85165e40aba26a2a /cpan/DB_File | |
parent | be0397089ddbb1fa5b54c3d442d9c23255e1bd87 (diff) | |
download | perl-ebf49c8bdb450d0923b895d19bea932bba5fb40c.tar.gz |
Update DB_File to CPAN version 1.822
[DELTA]
1.822 12 March 2011
* Keep DB_File's warnings in sync with perl's
[rt.cpan.org #66339]
Diffstat (limited to 'cpan/DB_File')
-rw-r--r-- | cpan/DB_File/Changes | 5 | ||||
-rw-r--r-- | cpan/DB_File/DB_File.pm | 15 | ||||
-rw-r--r-- | cpan/DB_File/t/db-btree.t | 2 | ||||
-rw-r--r-- | cpan/DB_File/t/db-hash.t | 4 | ||||
-rw-r--r-- | cpan/DB_File/t/db-recno.t | 4 |
5 files changed, 21 insertions, 9 deletions
diff --git a/cpan/DB_File/Changes b/cpan/DB_File/Changes index c7fbf1670f..79da038eed 100644 --- a/cpan/DB_File/Changes +++ b/cpan/DB_File/Changes @@ -1,5 +1,10 @@ +1.822 12 March 2011 + + * Keep DB_File's warnings in sync with perl's + [rt.cpan.org #66339] + 1.821 10 January 2011 * Fixed typos & spelling errors. diff --git a/cpan/DB_File/DB_File.pm b/cpan/DB_File/DB_File.pm index 7a47019998..7b8755bd54 100644 --- a/cpan/DB_File/DB_File.pm +++ b/cpan/DB_File/DB_File.pm @@ -161,16 +161,22 @@ package DB_File ; use warnings; use strict; our ($VERSION, @ISA, @EXPORT, $AUTOLOAD, $DB_BTREE, $DB_HASH, $DB_RECNO); -our ($db_version, $use_XSLoader, $splice_end_array, $Error); +our ($db_version, $use_XSLoader, $splice_end_array_no_length, $splice_end_array, $Error); use Carp; -$VERSION = "1.821" ; +$VERSION = "1.822" ; $VERSION = eval $VERSION; # needed for dev releases { - local $SIG{__WARN__} = sub {$splice_end_array = "@_";}; + local $SIG{__WARN__} = sub {$splice_end_array_no_length = "@_";}; my @a =(1); splice(@a, 3); + $splice_end_array_no_length = + ($splice_end_array_no_length =~ /^splice\(\) offset past end of array at /); +} +{ + local $SIG{__WARN__} = sub {$splice_end_array = "@_";}; + my @a =(1); splice(@a, 3, 1); $splice_end_array = ($splice_end_array =~ /^splice\(\) offset past end of array at /); } @@ -342,6 +348,7 @@ sub SPLICE $offset = 0; } + my $has_length = @_; my $length = @_ ? shift : 0; # Carping about definedness comes _after_ the OFFSET sanity check. # This is so we get the same error messages as Perl's splice(). @@ -371,7 +378,7 @@ sub SPLICE if ($offset > $size) { $offset = $size; warnings::warnif('misc', 'splice() offset past end of array') - if $splice_end_array; + if $has_length ? $splice_end_array : $splice_end_array_no_length; } # 'If LENGTH is omitted, removes everything from OFFSET onward.' diff --git a/cpan/DB_File/t/db-btree.t b/cpan/DB_File/t/db-btree.t index c0f6c57369..29c70a1743 100644 --- a/cpan/DB_File/t/db-btree.t +++ b/cpan/DB_File/t/db-btree.t @@ -5,7 +5,7 @@ use strict; use Config; BEGIN { - if($ENV{PERL_CORE}) { + if(-d "lib" && -f "TEST") { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; diff --git a/cpan/DB_File/t/db-hash.t b/cpan/DB_File/t/db-hash.t index d78e6646df..f4c8f957b0 100644 --- a/cpan/DB_File/t/db-hash.t +++ b/cpan/DB_File/t/db-hash.t @@ -1,11 +1,11 @@ #!./perl - + use warnings; use strict; use Config; BEGIN { - if($ENV{PERL_CORE}) { + if(-d "lib" && -f "TEST") { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; diff --git a/cpan/DB_File/t/db-recno.t b/cpan/DB_File/t/db-recno.t index 365abfd520..404a060fa7 100644 --- a/cpan/DB_File/t/db-recno.t +++ b/cpan/DB_File/t/db-recno.t @@ -1,11 +1,11 @@ #!./perl -w - + use warnings; use strict; use Config; BEGIN { - if($ENV{PERL_CORE}) { + if(-d "lib" && -f "TEST") { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; |