summaryrefslogtreecommitdiffstats
path: root/FTPServer.cpp
diff options
context:
space:
mode:
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)
{