diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-10-10 02:44:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-10-10 02:44:52 +0400 |
commit | 41ad6f9d0a5923a5f4607417c607d37a10317ee1 (patch) | |
tree | 6d57971d193c905bfe988591ac7f68ef787e5a8d | |
parent | e5d1c5a176607f8e4b2ee8a918734e8588d6a4b4 (diff) |
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.
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |