diff options
author | SCratORS <scrators@mail.ru> | 2021-11-15 11:25:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 11:25:29 +0100 |
commit | b6715f1db3d0b9076a4350c941a2e31afb70bc3b (patch) | |
tree | 7059974b5452ba835729906dc1c1b89880176988 | |
parent | Update FTPServer.cpp (diff) | |
download | FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar.gz FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar.bz2 FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar.lz FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar.xz FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.tar.zst FTPCLientServer-b6715f1db3d0b9076a4350c941a2e31afb70bc3b.zip |
-rw-r--r-- | FTPServer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/FTPServer.cpp b/FTPServer.cpp index 98f661e..f988b86 100644 --- a/FTPServer.cpp +++ b/FTPServer.cpp @@ -46,11 +46,10 @@ FTPServer::FTPServer(FS &_FSImplementation) : FTPCommon(_FSImplementation) aTimeout.resetToNeverExpires(); } -void FTPServer::begin(const String &uname, const String &pword, boolean _bUnixLst) +void FTPServer::begin(const String &uname, const String &pword) { _FTP_USER = uname; _FTP_PASS = pword; - bUnixLst = _bUnixLst; iniVariables(); @@ -563,8 +562,11 @@ int8_t FTPServer::processCommand() uint32_t fs = file.size(); String fileTime = makeDateTimeStr(file.getLastWrite()); file.close(); - if (cwd == FPSTR(aSlash) && fn[0] == '/') - fn.remove(0, 1); + dashPos = fn.lastIndexOf(F("/")); + if (dashPos >= 0) + { + fn.remove(0, dashPos + 1); + } if (FTP_CMD(LIST) == command) { |