Revision: 17000
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17000
Author:   campbellbarton
Date:     2008-10-10 00:44:52 +0200 (Fri, 10 Oct 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/fileops.c

Modified: trunk/blender/source/blender/blenlib/intern/fileops.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/fileops.c       2008-10-09 
22:28:44 UTC (rev 16999)
+++ trunk/blender/source/blender/blenlib/intern/fileops.c       2008-10-09 
22:44:52 UTC (rev 17000)
@@ -303,7 +303,8 @@
 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);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to