mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Fix file panel renaming unable to change the case of dirs on Windows
Tested on Windows 10.
This commit is contained in:
parent
6c173e2f7f
commit
85e99460b4
@ -256,6 +256,11 @@ Error DirAccessWindows::rename(String p_path, String p_new_path) {
|
||||
|
||||
// If we're only changing file name case we need to do a little juggling
|
||||
if (p_path.to_lower() == p_new_path.to_lower()) {
|
||||
if (dir_exists(p_path)) {
|
||||
// The path is a dir; just rename
|
||||
return ::_wrename((LPCWSTR)(p_path.utf16().get_data()), (LPCWSTR)(p_new_path.utf16().get_data())) == 0 ? OK : FAILED;
|
||||
}
|
||||
// The path is a file; juggle
|
||||
WCHAR tmpfile[MAX_PATH];
|
||||
|
||||
if (!GetTempFileNameW((LPCWSTR)(fix_path(get_current_dir()).utf16().get_data()), nullptr, 0, tmpfile)) {
|
||||
|
Loading…
Reference in New Issue
Block a user