From 579631819f0136ab0fbb0f6c7c21265b468940dc Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 18 Jun 2018 12:26:47 +0200 Subject: Fix T55503: File browser filter not working correctly. There were two issues here, introduced by rB66aa4af836: * Forgot to change length of some filter_glob var deep in filebrowser code. * Truncating filter_glob in general can be dangerous, generating unexpected patterns. Last point was the root of the issue here, truncating to 63 chars string left last group as 'match everything' `*` pattern. To fix that to some extent, added a new BLI_path_extension_glob_validate helper to BLI_path_util, which ensures we do not have last wildcards-only group in our pattern, when there are more than one group. --- source/blender/blenlib/BLI_path_util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenlib/BLI_path_util.h') diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index ebdf116ba7a..b4329bf81ac 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -75,6 +75,7 @@ bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() A bool BLI_path_extension_check_n(const char *str, ...) ATTR_NONNULL(1) ATTR_SENTINEL(0); bool BLI_path_extension_check_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; +bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL(); bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL(); bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL(); bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL(); -- cgit v1.2.3