about summary refs log tree commit
diff options
context:
space:
mode:
-rw-r--r--Net/FTP.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/Net/FTP.pm b/Net/FTP.pm
index af73e39..f8fc197 100644
--- a/Net/FTP.pm
+++ b/Net/FTP.pm
@@ -590,6 +590,9 @@ sub rmdir {
   return undef
     unless @filelist;    # failed, it is probably not a directory
 
+  return $ftp->delete($dir)
+    if @filelist == 1 and $dir eq $filelist[0];
+
   # Go thru and delete each file or the directory
   my $file;
   foreach $file (map { m,/, ? $_ : "$dir/$_" } @filelist) {