Make sure no additional slash being added with localize_path

This commit is contained in:
volzhs 2019-12-20 14:49:01 +09:00
parent 2a4c528d06
commit 02d5591d9d
1 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,10 @@ String ProjectSettings::localize_path(const String &p_path) const {
if (plocal == "") { if (plocal == "") {
return ""; 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); return plocal + path.substr(sep, path.size() - sep);
}; };
} }