Merge pull request #34476 from volzhs/no-slash-localize_path

Make sure no additional slash being added with localize_path
This commit is contained in:
Rémi Verschelde 2020-01-02 19:11:18 +01:00 committed by GitHub
commit eadf04e1dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
};
}