[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55128] trunk/blender/source/blender/ blenlib/intern/fileops.c: comment unused BLI_move() function, also fixed error where it would delete the file even if renaming failed.

Campbell Barton ideasman42 at gmail.com
Sat Mar 9 10:52:39 CET 2013


Revision: 55128
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55128
Author:   campbellbarton
Date:     2013-03-09 09:52:38 +0000 (Sat, 09 Mar 2013)
Log Message:
-----------
comment unused BLI_move() function, also fixed error where it would delete the file even if renaming failed.
- found when testing recursive_operation().

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	2013-03-09 09:38:27 UTC (rev 55127)
+++ trunk/blender/source/blender/blenlib/intern/fileops.c	2013-03-09 09:52:38 UTC (rev 55128)
@@ -283,6 +283,7 @@
 }
 
 /* Not used anywhere! */
+#if 0
 int BLI_move(const char *file, const char *to)
 {
 	int err;
@@ -312,8 +313,8 @@
 
 	return err;
 }
+#endif
 
-
 int BLI_copy(const char *file, const char *to)
 {
 	int err;
@@ -786,6 +787,8 @@
 	return RecursiveOp_Callback_OK;
 }
 
+/* Not used anywhere! */
+#if 0
 static int move_callback_pre(const char *from, const char *to)
 {
 	int ret = rename(from, to);
@@ -808,17 +811,17 @@
 
 /* if *file represents a directory, moves all its contents into *to, else renames
  * file itself to *to. */
-/* Not used anywhere! */
 int BLI_move(const char *file, const char *to)
 {
 	int ret = recursive_operation(file, to, move_callback_pre, move_single_file, NULL);
 
-	if (ret) {
+	if (ret && ret != -1) {
 		return recursive_operation(file, NULL, NULL, delete_single_file, delete_callback_post);
 	}
 
 	return ret;
 }
+#endif
 
 static char *check_destination(const char *file, const char *to)
 {




More information about the Bf-blender-cvs mailing list