From a20fef5d2eb411bf70ebe44f42417dfb7bd6fe3a Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 7 Mar 2017 00:40:47 +0000 Subject: Treat FTP MLSD commands case-insensitively RFC 3659 states that MLSD fact names and facts are case-insensitive. While most FTP servers prefer lowercase, some choose to use mixed-case, so match MLSD data case-insensitively. --- lib/Net/FTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm index 4c73647..50a071d 100644 --- a/lib/Net/FTP.pm +++ b/lib/Net/FTP.pm @@ -670,7 +670,7 @@ sub rmdir { # Try to delete the contents # Get a list of all the files in the directory, excluding the current and parent directories - my @filelist = map { /^(?:\S+;)+ (.+)$/ ? ($1) : () } grep { !/^(?:\S+;)*type=[cp]dir;/ } $ftp->_list_cmd("MLSD", $dir); + my @filelist = map { /^(?:\S+;)+ (.+)$/ ? ($1) : () } grep { !/^(?:\S+;)*type=[cp]dir;/i } $ftp->_list_cmd("MLSD", $dir); # Fallback to using the less well-defined NLST command if MLSD fails @filelist = grep { !/^\.{1,2}$/ } $ftp->ls($dir) -- cgit v1.2.3-24-ge0c7