summaryrefslogtreecommitdiffstats
path: root/FTPServer.cpp
diff options
context:
space:
mode:
authorDaniel Plasa <dplasa@gmail.com>2022-01-03 14:26:36 +0100
committerGitHub <noreply@github.com>2022-01-03 14:26:36 +0100
commit1dae672125d4a619e3815e2c50239bf048bfe36f (patch)
treecadcfb932590697a1d9bccabd08195a2048acecd /FTPServer.cpp
parentMerge pull request #11 from norbim1/patch-1 (diff)
parentUpdate FTPClient.cpp (diff)
downloadFTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar.gz
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar.bz2
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar.lz
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar.xz
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.tar.zst
FTPCLientServer-1dae672125d4a619e3815e2c50239bf048bfe36f.zip
Diffstat (limited to 'FTPServer.cpp')
-rw-r--r--FTPServer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/FTPServer.cpp b/FTPServer.cpp
index 0e87fba..f988b86 100644
--- a/FTPServer.cpp
+++ b/FTPServer.cpp
@@ -562,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)
{