mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01: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:
parent
3af5eef964
commit
e4ee6548af
@ -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 == ".."){
|
||||
|
Loading…
Reference in New Issue
Block a user