Merge pull request #622 from cmitu/fix-path

getGenericPath: don't remove trailing '/' when path is '/'.
This commit is contained in:
Jools Wills 2019-12-10 05:30:43 +00:00 committed by GitHub
commit 7e687d7f4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,8 +237,8 @@ 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)))
// remove trailing '/' when the path is more than a simple '/'
while(path.length() > 1 && ((offset = path.find_last_of('/')) == (path.length() - 1)))
path.erase(offset, 1);
// return generic path