Skip to content

Commit e4ee654

Browse files
committed
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

src/filesys.cpp

Lines changed: 1 addition & 1 deletion
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 == ".."){

0 commit comments

Comments
 (0)