diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index 23234ee07..9119cc17e 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -226,6 +226,10 @@ namespace Utils while((offset = path.find("//")) != std::string::npos) path.erase(offset, 1); + // remove trailing '/' + while(path.length() && ((offset = path.find_last_of('/')) == (path.length() - 1))) + path.erase(offset, 1); + // return generic path return path;