diff options
author | Ton Roosendaal <ton@blender.org> | 2011-01-30 16:12:03 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-01-30 16:12:03 +0300 |
commit | c7834e0e6e12cd613d645f2178ea0495a28592ab (patch) | |
tree | eab66e65230f8f42c6910581fb244c9fb11cff8d /source/blender/blenlib | |
parent | 9d0b8486c89e70b59325b84107394990ae00c3cb (diff) |
And here's a decent fix for correctly recognizing the the
.blend1 etc backups.
Proves again that lazy coders only make bad code :)
Implementation note:
The filewindow now recoginizes .blend version backups as
a special type, so filtering for .blend files themselves
ignores it. However, they're recognized correctly as valid
.blend files, and draw an icon as .blend file when filtering
is off. Can become a distinct icon if we want...
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 06dfd626420..aa5a775c746 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1315,24 +1315,20 @@ 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; - int retval= 0; + int retval; a= strlen(str); b= strlen(ext); if(a==0 || b==0 || b>=a) { retval = 0; - } - else { - /* allow .blend1 .blend2 */ - char *loc= BLI_strcasestr(str+a-b-1, ext); - - if(loc) - retval= 1; + } else if (BLI_strcasecmp(ext, str + a - b)) { + retval = 0; + } else { + retval = 1; } return (retval); |