From: Rafael Garcia-Suarez Date: Tue, 11 Sep 2007 09:28:02 +0000 (+0000) Subject: Upgrade to libnet 1.22 (with some help by Jerry Hedden) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c7564925f172c80f4f5e495ffe3564f3687bb91;p=p5sagit%2Fp5-mst-13.2.git Upgrade to libnet 1.22 (with some help by Jerry Hedden) p4raw-id: //depot/perl@31844 --- diff --git a/lib/Net/Changes b/lib/Net/Changes index fd51d03..ff26b1d 100644 --- a/lib/Net/Changes +++ b/lib/Net/Changes @@ -1,3 +1,8 @@ +libnet 1.22 -- Sun Aug 26 07:13:18 CDT 2007 + +Bug Fixes + * Fix a bug in Net::Cmd that is_utf8 does not exist prior to perl 5.8.1 + libnet 1.21 -- Sat May 19 08:53:09 CDT 2007 Bug Fixes diff --git a/lib/Net/Cmd.pm b/lib/Net/Cmd.pm index 355b6c9..4f0e444 100644 --- a/lib/Net/Cmd.pm +++ b/lib/Net/Cmd.pm @@ -22,9 +22,22 @@ BEGIN { } } -my $doUTF8 = eval { require utf8 }; +BEGIN { + if (!eval { require utf8 }) { + *is_utf8 = sub { 0 }; + } + elsif (eval { utf8::is_utf8(undef); 1 }) { + *is_utf8 = \&utf8::is_utf8; + } + elsif (eval { require Encode; Encode::is_utf8(undef); 1 }) { + *is_utf8 = \&Encode::is_utf8; + } + else { + *is_utf8 = sub { $_[0] =~ /[^\x00-\xff]/ }; + } +} -$VERSION = "2.28"; +$VERSION = "2.29"; @ISA = qw(Exporter); @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING); @@ -386,11 +399,9 @@ sub datasend { my $arr = @_ == 1 && ref($_[0]) ? $_[0] : \@_; my $line = join("", @$arr); - if ($doUTF8) { - # encode to individual utf8 bytes if - # $line is a string (in internal UTF-8) - utf8::encode($line) if utf8::is_utf8($line); - } + # encode to individual utf8 bytes if + # $line is a string (in internal UTF-8) + utf8::encode($line) if is_utf8($line); return 0 unless defined(fileno($cmd)); diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm index 08c3dc3..9ed6d38 100644 --- a/lib/Net/FTP.pm +++ b/lib/Net/FTP.pm @@ -1468,7 +1468,7 @@ The alloc command allows you to give the ftp server a hint about the size of the file about to be transferred using the ALLO ftp command. Some storage systems use this to make intelligent decisions about how to store the file. The C argument represents the size of the file in bytes. The -C argument indicates a mazimum record or page size for files +C argument indicates a maximum record or page size for files sent with a record or page structure. The size of the file will be determined, and sent to the server