From b6715f1db3d0b9076a4350c941a2e31afb70bc3b Mon Sep 17 00:00:00 2001 From: SCratORS Date: Mon, 15 Nov 2021 13:25:29 +0300 Subject: Update FTPServer.cpp --- FTPServer.cpp | 10 ++++++---- 1 file 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) { -- cgit v1.2.3