File: key-named-zero.patch

package info (click to toggle)
libnet-amazon-s3-perl 0.44-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 128 kB
  • ctags: 51
  • sloc: perl: 860; makefile: 42
file content (24 lines) | stat: -rw-r--r-- 901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Author: Joey Hess <joeyh@debian.org>
Description: Allow storing a key named "0".
Upstream bug report: http://rt.cpan.org//Ticket/Display.html?id=35705

--- libnet-amazon-s3-perl.orig/lib/Net/Amazon/S3/Bucket.pm
+++ libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm
@@ -112,7 +112,7 @@
 # returns bool
 sub add_key {
     my ( $self, $key, $value, $conf ) = @_;
-    croak 'must specify key' unless $key && length $key;
+    croak 'must specify key' unless defined $key && length $key;
 
     if ( $conf->{acl_short} ) {
         $self->account->_validate_acl_short( $conf->{acl_short} );
@@ -260,7 +260,7 @@
 # returns bool
 sub delete_key {
     my ( $self, $key ) = @_;
-    croak 'must specify key' unless $key && length $key;
+    croak 'must specify key' unless defined $key && length $key;
     return $self->account->_send_request_expect_nothing( 'DELETE',
         $self->_uri($key), {} );
 }