浏览代码

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

Make sure no additional slash being added with localize_path
Rémi Verschelde 5 年之前
父节点
当前提交
eadf04e1dd
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      core/project_settings.cpp

+ 4 - 0
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);
 	};
 }