1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-05 00:45:05 -05:00

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.
This commit is contained in:
ShadowNinja 2016-11-24 10:35:48 -05:00
parent 3af5eef964
commit e4ee6548af

View File

@ -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 == ".."){