diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-03 07:57:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-03 07:57:24 +0300 |
commit | 622019a085c4a1e4290d588307cd8ab095c70231 (patch) | |
tree | 46c2dda1dd368c79c2fc279101641838d7f3d8d1 /source/blender/blenlib/intern/fileops.c | |
parent | 36b516cb979cfb809f5943a062fb35b8b2ffe911 (diff) |
Fix BLI_rename returned success w/ missing source path
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 401bdd445e5..db4b3bcf20c 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -720,6 +720,8 @@ int BLI_access(const char *filename, int mode) /** * Deletes the specified file or directory (depending on dir), optionally * doing recursive delete of directory contents. + * + * \return zero on success (matching 'remove' behavior). */ int BLI_delete(const char *file, bool dir, bool recursive) { @@ -1043,9 +1045,14 @@ bool BLI_dir_create_recursive(const char *dirname) return ret; } +/** + * \return zero on success (matching 'rename' behavior). + */ int BLI_rename(const char *from, const char *to) { - if (!BLI_exists(from)) return 0; + if (!BLI_exists(from)) { + return 1; + } if (BLI_exists(to)) if (BLI_delete(to, false, false)) return 1; |