about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2003-10-18 10:03:03 +0000
committerGraham Barr <gbarr@pobox.com>2003-10-18 10:03:03 +0000
commit29a7374a7dd6ca5f4e8ae4256172edf0f9268111 (patch)
tree5408544c0cbe7a899caea15d7734e503a6147984
parentd3cdbc7eabeebc190b163c8cca6f254815226c4c (diff)
downloadperl-libnet-29a7374a7dd6ca5f4e8ae4256172edf0f9268111.tar.gz
Net::FTP
- Support some non-standard servers that place the word bytes
  in the response to SIZE

-rw-r--r--Net/FTP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index 5ec09b5..32471ea 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -22,7 +22,7 @@ use Net::Config;
 use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC);
 # use AutoLoader qw(AUTOLOAD);
 
-$VERSION = "2.73"; # $Id: //depot/libnet/Net/FTP.pm#81 $
+$VERSION = "2.74"; # $Id: //depot/libnet/Net/FTP.pm#82 $
 @ISA     = qw(Exporter Net::Cmd IO::Socket::INET);
 
 # Someday I will "use constant", when I am not bothered to much about
@@ -206,7 +206,7 @@ sub size {
   my $io;
   if($ftp->supported("SIZE")) {
     return $ftp->_SIZE($file)
-        ? ($ftp->message =~ /(\d+)\s*$/)[0]
+        ? ($ftp->message =~ /(\d+)\s*(bytes?\s*)?$/)[0]
         : undef;
  }
  elsif($ftp->supported("STAT")) {