From 15ccfc5a05ca82fe443c5844d57255563090479c Mon Sep 17 00:00:00 2001 From: Tomas Jakobsson Date: Mon, 20 Aug 2018 15:32:31 +0200 Subject: [PATCH] Remove trailing '/' in getGenericPath --- es-core/src/utils/FileSystemUtil.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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;