فهرست منبع

Fix DirAccessWindows::make_dir() choking on ".."

`CreateDirectoryW()` chokes on absolute paths that contain `..`
example: "C:\\workspace\\..\\games\\assets"
Simplifying the path before creating the dir fixes this.
nikitalita 3 سال پیش
والد
کامیت
0d3d5ac769
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/windows/dir_access_windows.cpp

+ 1 - 1
drivers/windows/dir_access_windows.cpp

@@ -160,7 +160,7 @@ Error DirAccessWindows::make_dir(String p_dir) {
 		p_dir = current_dir.path_join(p_dir);
 	}
 
-	p_dir = p_dir.replace("/", "\\");
+	p_dir = p_dir.simplify_path().replace("/", "\\");
 
 	bool success;
 	int err;