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:
Campbell Barton 2008-10-09 22:44:52 +00:00
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);