diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 13:52:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 13:52:38 +0400 |
commit | 35b9fcb8718d96af9b5c6292ea19bdd64b4b8406 (patch) | |
tree | 4c1bb154caed643acf43731d901ed2c6bf21ff4a /source/blender/blenlib/intern/fileops.c | |
parent | edf4855a38e3ee24874431f7c6321f04cb6d1b2f (diff) |
comment unused BLI_move() function, also fixed error where it would delete the file even if renaming failed.
- found when testing recursive_operation().
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 9 |
1 files changed, 6 insertions, 3 deletions
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) { |