From 35b9fcb8718d96af9b5c6292ea19bdd64b4b8406 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Mar 2013 09:52:38 +0000 Subject: comment unused BLI_move() function, also fixed error where it would delete the file even if renaming failed. - found when testing recursive_operation(). --- source/blender/blenlib/intern/fileops.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib/intern/fileops.c') diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index a4caa571bb2..bda67e2eb74 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -283,6 +283,7 @@ int BLI_delete(const char *file, bool dir, bool recursive) } /* Not used anywhere! */ +#if 0 int BLI_move(const char *file, const char *to) { int err; @@ -312,7 +313,7 @@ int BLI_move(const char *file, const char *to) return err; } - +#endif int BLI_copy(const char *file, const char *to) { @@ -786,6 +787,8 @@ static int copy_single_file(const char *from, const char *to) 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 @@ static int move_single_file(const char *from, const char *to) /* 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) { -- cgit v1.2.3