summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authornikitalita <69168929+nikitalita@users.noreply.github.com>2022-09-26 12:24:02 -0700
committernikitalita <69168929+nikitalita@users.noreply.github.com>2022-09-26 12:24:02 -0700
commit0d3d5ac76983de35b8c1dddd65a4c2f8be74d555 (patch)
tree320f5356a06252335e18ad692a4a4600b863ead9 /drivers
parent84f2c68c84bde10026454292578e5fdcc9ab69a3 (diff)
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.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/windows/dir_access_windows.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index 11fd29c8f5..7dd294c7a1 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/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;