diff options
author | ShadowNinja <shadowninja@minetest.net> | 2016-11-24 10:35:48 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2016-11-24 10:38:23 -0500 |
commit | e4ee6548afd01040046ee3780d0fbb121d141251 (patch) | |
tree | e36f66f1e50ce7d7ef934e429a12865ad3facab6 | |
parent | 3af5eef96463510a27cf06b9c3ecc9f1d04cdac6 (diff) | |
download | minetest-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.
-rw-r--r-- | src/filesys.cpp | 2 |
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 == ".."){ |