From e1a39d66b0f2e77f310c66169b566e4fe19ba5dd Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Mon, 26 Sep 2022 12:24:02 -0700 Subject: [PATCH] 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. (cherry picked from commit 0d3d5ac76983de35b8c1dddd65a4c2f8be74d555) --- drivers/windows/dir_access_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index f9656f28012..d0a36d18666 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -154,7 +154,7 @@ Error DirAccessWindows::make_dir(String p_dir) { if (p_dir.is_rel_path()) p_dir = current_dir.plus_file(p_dir); - p_dir = p_dir.replace("/", "\\"); + p_dir = p_dir.simplify_path().replace("/", "\\"); bool success; int err;