From 02d5591d9df4af4350e25de96a909bc89b6f1f08 Mon Sep 17 00:00:00 2001 From: volzhs Date: Fri, 20 Dec 2019 14:49:01 +0900 Subject: [PATCH] Make sure no additional slash being added with localize_path --- core/project_settings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 067578e3542..7110337204a 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -107,6 +107,10 @@ String ProjectSettings::localize_path(const String &p_path) const { if (plocal == "") { return ""; }; + // Only strip the starting '/' from 'path' if its parent ('plocal') ends with '/' + if (plocal[plocal.length() - 1] == '/') { + sep += 1; + } return plocal + path.substr(sep, path.size() - sep); }; }