Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_storage_types.h1
-rw-r--r--source/blender/blenlib/intern/fileops.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_storage_types.h b/source/blender/blenlib/BLI_storage_types.h
index cdc85d1be39..36d96f6075c 100644
--- a/source/blender/blenlib/BLI_storage_types.h
+++ b/source/blender/blenlib/BLI_storage_types.h
@@ -77,7 +77,6 @@ struct direntry{
#define SELECT 1
#define HIDDEN 1
#define FIRST 1
-#define ACTIVE 2
#define DESELECT 0
#define NOT_YET 0
#define VISIBLE 0
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 42fd75a543e..b9c0dd65ede 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -311,10 +311,10 @@ void BLI_recurdir_fileops(char *dirname) {
int BLI_rename(char *from, char *to) {
if (!BLI_exists(from)) return 0;
- /* make sure the filenames are different (case insensitive) before removing */
- if (BLI_exists(to) && BLI_strcasecmp(from, to))
- if(BLI_delete(to, 0, 0)) return 1;
-
+ /* refuse to rename if file already exists */
+ if (BLI_exists(to))
+ return 1;
+
return rename(from, to);
}
@@ -391,8 +391,9 @@ void BLI_recurdir_fileops(char *dirname) {
int BLI_rename(char *from, char *to) {
if (!BLI_exists(from)) return 0;
- if (BLI_exists(to)) if(BLI_delete(to, 0, 0)) return 1;
-
+ /* refuse to rename if file already exists */
+ if (BLI_exists(to)) return 1;
+
return rename(from, to);
}