about summary refs log tree commit
path: root/Net/FTP.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Net/FTP.pm')
-rw-r--r--Net/FTP.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index 2086a4d..32733af 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -21,7 +21,7 @@ use Net::Cmd;
 use Net::Config;
 # use AutoLoader qw(AUTOLOAD);
 
-$VERSION = "2.41"; # $Id: //depot/libnet/Net/FTP.pm#26 $
+$VERSION = "2.42"; # $Id: //depot/libnet/Net/FTP.pm#27 $
 @ISA     = qw(Exporter Net::Cmd IO::Socket::INET);
 
 # Someday I will "use constant", when I am not bothered to much about
@@ -633,10 +633,19 @@ sub supported {
     return $hash->{$cmd}
         if exists $hash->{$cmd};
 
-    my $ok = $ftp->_HELP($cmd) &&
-        $ftp->message !~ /unimplemented/i;
+    return $hash->{$cmd} = 0
+        unless $ftp->_HELP($cmd);
 
-    $hash->{$cmd} = $ok;
+    my $text = $ftp->message;
+    if($text =~ /following\s+commands/i) {
+        $text =~ s/.*\n//;
+        $text =~ s/\n/ /sog;
+        while($text =~ /(\w+)([* ])/g) {
+            $hash->{"\U$1"} = $2 eq " " ? 1 : 0;
+        }
+    }
+
+    $hash->{$cmd} ||= 0;
 }
 
 ##