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

Support for file not found in ConfigFile::Load and handle a few specific cases

EditorSettings::set_project_metadata: creates project_metadata.cfg if it doesn't exist
EditorPlugin::get_config: removed (not used)

Fixes #31444
This commit is contained in:
PouleyKetchoupp
2019-08-20 13:59:46 +02:00
parent fb5e8b509b
commit b49226e085
7 changed files with 23 additions and 20 deletions

View File

@@ -114,11 +114,18 @@ Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) {
path = path + ".tmp";
}
_wfopen_s(&f, path.c_str(), mode_string);
errno_t errcode = _wfopen_s(&f, path.c_str(), mode_string);
if (f == NULL) {
last_error = ERR_FILE_CANT_OPEN;
return ERR_FILE_CANT_OPEN;
switch (errcode) {
case ENOENT: {
last_error = ERR_FILE_NOT_FOUND;
} break;
default: {
last_error = ERR_FILE_CANT_OPEN;
} break;
}
return last_error;
} else {
last_error = OK;
flags = p_mode_flags;