fix for [#12255] Rename the File at File Window,the file is deleted
renaming a file on win32 would delete it because it didnt test if the 2 filenames were the same (case insensitive), and remove the 'to' file to make way for the 'from' file.
This commit is contained in:
parent
e5d1c5a176
commit
41ad6f9d0a
@ -303,7 +303,8 @@ void BLI_recurdir_fileops(char *dirname) {
|
||||
int BLI_rename(char *from, char *to) {
|
||||
if (!BLI_exists(from)) return 0;
|
||||
|
||||
if (BLI_exists(to))
|
||||
/* make sure the filenames are different (case insensitive) before removing */
|
||||
if (BLI_exists(to) && strcasecmp(from, to))
|
||||
if(BLI_delete(to, 0, 0)) return 1;
|
||||
|
||||
return rename(from, to);
|
||||
|
Loading…
Reference in New Issue
Block a user