summaryrefslogtreecommitdiff
path: root/src/filesys.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2016-11-24 10:35:48 -0500
committerShadowNinja <shadowninja@minetest.net>2016-11-24 10:38:23 -0500
commite4ee6548afd01040046ee3780d0fbb121d141251 (patch)
treee36f66f1e50ce7d7ef934e429a12865ad3facab6 /src/filesys.cpp
parent3af5eef96463510a27cf06b9c3ecc9f1d04cdac6 (diff)
downloadminetest-e4ee6548afd01040046ee3780d0fbb121d141251.tar.gz
minetest-e4ee6548afd01040046ee3780d0fbb121d141251.tar.bz2
minetest-e4ee6548afd01040046ee3780d0fbb121d141251.zip
Fix fs::RemoveRelativePathComponents for paths with a leading dot component
Previously, paths like ./worlds would be resolved to /worlds since the leading dot was considered just as irrelevant as a dot in the middle of the path.
Diffstat (limited to 'src/filesys.cpp')
-rw-r--r--src/filesys.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/filesys.cpp b/src/filesys.cpp
index b4c52ab79..c718a9689 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -631,7 +631,7 @@ std::string RemoveRelativePathComponents(std::string path)
std::string component = path.substr(component_start,
component_end - component_start);
bool remove_this_component = false;
- if(component == "."){
+ if(component == "." && component_start != 0){
remove_this_component = true;
}
else if(component == ".."){