From: ShadowNinja Date: Thu, 24 Nov 2016 15:35:48 +0000 (-0500) Subject: Fix fs::RemoveRelativePathComponents for paths with a leading dot component X-Git-Tag: 0.4.15~101 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e4ee6548afd01040046ee3780d0fbb121d141251;p=oweals%2Fminetest.git 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. --- diff --git a/src/filesys.cpp b/src/filesys.cpp index b4c52ab79..c718a9689 100644 --- a/src/filesys.cpp +++ b/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 == ".."){