diff options
author | nikitalita <69168929+nikitalita@users.noreply.github.com> | 2022-09-26 12:24:02 -0700 |
---|---|---|
committer | nikitalita <69168929+nikitalita@users.noreply.github.com> | 2022-09-26 12:24:02 -0700 |
commit | 0d3d5ac76983de35b8c1dddd65a4c2f8be74d555 (patch) | |
tree | 320f5356a06252335e18ad692a4a4600b863ead9 /drivers | |
parent | 84f2c68c84bde10026454292578e5fdcc9ab69a3 (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.cpp | 2 |
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; |