summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-02 19:11:18 +0100
committerGitHub <noreply@github.com>2020-01-02 19:11:18 +0100
commiteadf04e1ddc43f8b103b96198b46de130e8b1e57 (patch)
treed83ea2a9d4badc77fc82018a7034368eec5f89b7 /core
parentd84cf797a2036beddf2b44948b99c7aa813fcc30 (diff)
parent02d5591d9df4af4350e25de96a909bc89b6f1f08 (diff)
Merge pull request #34476 from volzhs/no-slash-localize_path
Make sure no additional slash being added with localize_path
Diffstat (limited to 'core')
-rw-r--r--core/project_settings.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index c65c6252d6..a30967dcca 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);
};
}