Skip to content

Commit e4ee654

Browse files
committedNov 24, 2016
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.
1 parent 3af5eef commit e4ee654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/filesys.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ std::string RemoveRelativePathComponents(std::string path)
631631
std::string component = path.substr(component_start,
632632
component_end - component_start);
633633
bool remove_this_component = false;
634-
if(component == "."){
634+
if(component == "." && component_start != 0){
635635
remove_this_component = true;
636636
}
637637
else if(component == ".."){

1 commit comments

Comments
 (1)

TeTpaAka commented on Nov 25, 2016

@TeTpaAka
Contributor

You should update the unittest accordingly.

Please sign in to comment.