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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-04-03 17:17:17 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-04-03 17:20:18 +0300
commitb444887054297d83c560e860219a5c598d390935 (patch)
treec4253fd47ae49efa89b17e5e693cd2d2193cc154 /source/blender/editors/space_file/filesel.c
parent3f30ebf64aee964362874aaf985b092b8bc3de8e (diff)
Fix T44243: File browser behavior is inconsistent between append and open.
Only basic fix, the whole 'dir' field handling needs rework to correctly support lib stuff (will be done as part of asset-experiment rewriting work)... All this code is doing way too much filesystem inspection by itself, instead of reusing flielist.c work - this is stupid, and will completely break with future asset engines!
Diffstat (limited to 'source/blender/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 14b72eb8f6d..6858f536e92 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -642,8 +642,8 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matche
*/
for (i = 0; i < n; i++) {
file = filelist_file(sfile->files, i);
- /* use same rule as 'FileCheckType.CHECK_FILES' */
- if (S_ISREG(file->type) && (fnmatch(pattern, file->relname, 0) == 0)) {
+ /* Do not check wether file is a file or dir here! Causes T44243 (we do accept dirs at this stage). */
+ if (fnmatch(pattern, file->relname, 0) == 0) {
file->selflag |= FILE_SEL_SELECTED;
if (!match) {
BLI_strncpy(matched_file, file->relname, FILE_MAX);
@@ -694,13 +694,8 @@ int autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
closedir(dir);
match = UI_autocomplete_end(autocpl, str);
- if (match) {
- if (match == AUTOCOMPLETE_FULL_MATCH) {
- BLI_add_slash(str);
- }
- else {
- BLI_strncpy(sfile->params->dir, str, sizeof(sfile->params->dir));
- }
+ if (match == AUTOCOMPLETE_FULL_MATCH) {
+ BLI_add_slash(str);
}
}
}