diff options
author | Ton Roosendaal <ton@blender.org> | 2011-01-29 20:47:22 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-01-29 20:47:22 +0300 |
commit | ff58fc3e86dd00295cc55caf835dc6ac6d22ba96 (patch) | |
tree | 97300bbba3a3133acadbca65fb5eb57f8949bb1b /source | |
parent | aef43569094a7546c91715fe1ac4efa0bbbe0c83 (diff) |
Todo list fix: .blend backup files are recognized as such now;
for drop inside Blender window and icons. (.blend1, .blend2, etc).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 11 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 0e46a9df4fc..f449c2be437 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1315,6 +1315,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, BLI_clean(string); } +/* if ext is .blend*, it doesn't compare last char */ int BLI_testextensie(const char *str, const char *ext) { short a, b; @@ -1325,10 +1326,12 @@ int BLI_testextensie(const char *str, const char *ext) if(a==0 || b==0 || b>=a) { retval = 0; - } else if (BLI_strcasecmp(ext, str + a - b)) { - retval = 0; - } else { - retval = 1; + } + else { + if(ext[b-1]=='*') + retval= 0==BLI_strncasecmp(ext, str + a - b, b-1); + else + retval= 0==BLI_strcasecmp(ext, str + a - b); } return (retval); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 77230637342..cbf3fd571dd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1039,7 +1039,7 @@ void blo_freefiledata(FileData *fd) int BLO_has_bfile_extension(char *str) { - return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend")||BLI_testextensie(str, ".blend.gz")); + return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend*")||BLI_testextensie(str, ".blend.gz")); } int BLO_is_a_library(const char *path, char *dir, char *group) |