From e4ee6548afd01040046ee3780d0fbb121d141251 Mon Sep 17 00:00:00 2001
From: ShadowNinja <shadowninja@minetest.net>
Date: Thu, 24 Nov 2016 10:35:48 -0500
Subject: [PATCH] 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.
---
 src/filesys.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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