mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
@@ -631,7 +631,7 @@ std::string RemoveRelativePathComponents(std::string path)
|
|||||||
std::string component = path.substr(component_start,
|
std::string component = path.substr(component_start,
|
||||||
component_end - component_start);
|
component_end - component_start);
|
||||||
bool remove_this_component = false;
|
bool remove_this_component = false;
|
||||||
if(component == "."){
|
if(component == "." && component_start != 0){
|
||||||
remove_this_component = true;
|
remove_this_component = true;
|
||||||
}
|
}
|
||||||
else if(component == ".."){
|
else if(component == ".."){
|
||||||
|
Reference in New Issue
Block a user