瀏覽代碼

[Windows] Fix handling X: paths.

bruvzg 1 年之前
父節點
當前提交
b130cf0361
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/windows/dir_access_windows.cpp

+ 3 - 1
drivers/windows/dir_access_windows.cpp

@@ -71,7 +71,9 @@ struct DirAccessWindowsPrivate {
 
 
 String DirAccessWindows::fix_path(const String &p_path) const {
 String DirAccessWindows::fix_path(const String &p_path) const {
 	String r_path = DirAccess::fix_path(p_path.trim_prefix(R"(\\?\)").replace("\\", "/"));
 	String r_path = DirAccess::fix_path(p_path.trim_prefix(R"(\\?\)").replace("\\", "/"));
-
+	if (r_path.ends_with(":")) {
+		r_path += "/";
+	}
 	if (r_path.is_relative_path()) {
 	if (r_path.is_relative_path()) {
 		r_path = current_dir.trim_prefix(R"(\\?\)").replace("\\", "/").path_join(r_path);
 		r_path = current_dir.trim_prefix(R"(\\?\)").replace("\\", "/").path_join(r_path);
 	} else if (r_path == ".") {
 	} else if (r_path == ".") {