From 41ad6f9d0a5923a5f4607417c607d37a10317ee1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Oct 2008 22:44:52 +0000 Subject: [PATCH] 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. --- source/blender/blenlib/intern/fileops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 2acbbbe6712..fd9bb17071a 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -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);