1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

[Windows] Fix windows is_path_invalid, and apply it to directory creation.

(cherry picked from commit be8f60a78d)
This commit is contained in:
bruvzg
2024-02-09 10:47:07 +02:00
committed by Rémi Verschelde
parent dea652d9a2
commit 1e55de9b8b
3 changed files with 11 additions and 7 deletions

View File

@@ -31,6 +31,7 @@
#if defined(WINDOWS_ENABLED)
#include "dir_access_windows.h"
#include "file_access_windows.h"
#include "core/config/project_settings.h"
#include "core/os/memory.h"
@@ -177,6 +178,13 @@ Error DirAccessWindows::make_dir(String p_dir) {
p_dir = fix_path(p_dir);
}
if (FileAccessWindows::is_path_invalid(p_dir)) {
#ifdef DEBUG_ENABLED
WARN_PRINT("The path :" + p_dir + " is a reserved Windows system pipe, so it can't be used for creating directories.");
#endif
return ERR_INVALID_PARAMETER;
}
p_dir = p_dir.simplify_path().replace("/", "\\");
bool success;