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-01-04 19:54:12 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-04 19:57:39 +0300
commita08c5e1183731cdafd85ecf51c587cabf39da19b (patch)
treee7fa1d7173f4614130d73d08c79cff457dd6b64b /source/blender/editors/space_file/filelist.c
parent8abdc89912e4ae042eeeb5f0e33e833a89eefb8f (diff)
Partial fix for T43113: Filebrowser: Empty folders do not contain go back arrow.
Do not allow going into un-readable directories at all. Note we might want to reflect that 'state' in UI for users too, but that will be for later. Also, not quite sure this fix the windows case, will have to start my VM... :/
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r--source/blender/editors/space_file/filelist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 2e6dc7bc5c0..f35a20778c2 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -973,9 +973,14 @@ static void filelist_read_dir(struct FileList *filelist)
filelist->fidx = NULL;
filelist->filelist = NULL;
+ BLI_make_exist(filelist->dir);
BLI_cleanup_dir(G.main->name, filelist->dir);
filelist->numfiles = BLI_filelist_dir_contents(filelist->dir, &(filelist->filelist));
+ /* We shall *never* get an empty list here, since we now the dir exists and is readable
+ * (ensured by BLI_make_exist()). So we expect at the very least the parent '..' entry. */
+ BLI_assert(filelist->numfiles != 0);
+
filelist_setfiletypes(filelist);
}
@@ -994,7 +999,6 @@ static void filelist_read_library(struct FileList *filelist)
int num;
struct direntry *file;
- BLI_make_exist(filelist->dir);
filelist_read_dir(filelist);
file = filelist->filelist;
for (num = 0; num < filelist->numfiles; num++, file++) {