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.
master
ShadowNinja 2016-11-24 10:35:48 -05:00
parent 3af5eef964
commit e4ee6548af
1 changed files with 1 additions and 1 deletions

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