From: rkinyon@cpan.org Date: Fri, 27 Jun 2008 02:53:24 +0000 (+0000) Subject: Fixed storage->size to only return what the size of the DB is, not the file as a... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3c5ac069e63f4c335f3488f6f32b1f00bd3a0d8;p=dbsrgits%2FDBM-Deep.git Fixed storage->size to only return what the size of the DB is, not the file as a whole git-svn-id: http://svn.ali.as/cpan/trunk/DBM-Deep@3645 88f4d9cd-8a04-0410-9d60-8f63309c3137 --- diff --git a/lib/DBM/Deep/File.pm b/lib/DBM/Deep/File.pm index aa1ea32..7a89e11 100644 --- a/lib/DBM/Deep/File.pm +++ b/lib/DBM/Deep/File.pm @@ -91,7 +91,7 @@ sub size { my $self = shift; return 0 unless $self->{fh}; - return -s $self->{fh}; + return( (-s $self->{fh}) - $self->{file_offset} ); } sub set_inode { diff --git a/t/27_filehandle.t b/t/27_filehandle.t index aff3007..006f26a 100644 --- a/t/27_filehandle.t +++ b/t/27_filehandle.t @@ -98,7 +98,7 @@ locking => 0, } qr/Cannot write to a readonly filehandle/, "Can't write to a read-only filehandle"; ok( !$db->exists( 'foo' ), "foo still doesn't exist" ); - is( $db->{x}, 'b' ); + is( $db->{x}, 'b', "x is still 'b'" ); } exec( "$^X -Iblib/lib $filename" );