Skip to content
Permalink
Browse files

Fix fs::RemoveRelativePathComponents for paths with a leading dot com…

…ponent

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.
  • Loading branch information
ShadowNinja committed Nov 24, 2016
1 parent 3af5eef commit e4ee6548afd01040046ee3780d0fbb121d141251
Showing with 1 addition and 1 deletion.
  1. +1 −1 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 == ".."){

1 comment on commit e4ee654

@TeTpaAka

This comment has been minimized.

Copy link
Contributor

@TeTpaAka TeTpaAka commented on e4ee654 Nov 25, 2016

You should update the unittest accordingly.

Please sign in to comment.
You can’t perform that action at this time.