2
0
Эх сурвалжийг харах

Make sure no additional slash being added with localize_path

volzhs 5 жил өмнө
parent
commit
02d5591d9d

+ 4 - 0
core/project_settings.cpp

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