Path: Avoid adding a double slash from root.

This commit is contained in:
Unknown W. Brackets committed 2021-10-20 13:01:16 -07:00
1 parent 11eb5fa0c2
commit d5dac66c7a
1 file changed
+1 -1
+1 -1
View File
@@ -87,7 +87,7 @@ Path Path::operator /(const std::string &subdir) const {
return Path(path_);
}
std::string fullPath = path_;
if (subdir.front() != '/') {
if (subdir.front() != '/' && (fullPath.empty() || fullPath.back() != '/')) {
fullPath += "/";
}
fullPath += subdir;