diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-15 18:26:41 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-15 18:35:42 +0300 |
commit | 1c64543aefd5c78540dc3de5254c0dd54649ca81 (patch) | |
tree | 4619f9f49f62a08d565e24baf87ef6e5150ffc5b /source/blender/editors/space_file/file_ops.c | |
parent | f1ee11fcca20ce1fb7db97a71e7e345c6faad69a (diff) |
Cleanup of SpaceFile, from asset-experiments branch mostly.
Helps keeping diff with branch relevant and clean...
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ddf9545289e..6cc4446274a 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -179,16 +179,18 @@ static FileSelect file_select_do(bContext *C, int selected_idx, bool do_diropen) params->active_file = selected_idx; if (S_ISDIR(file->type)) { + const bool is_parent_dir = FILENAME_IS_PARENT(file->relname); + if (do_diropen == false) { params->file[0] = '\0'; retval = FILE_SELECT_DIR; } /* the path is too long and we are not going up! */ - else if (!FILENAME_IS_PARENT(file->relname) && strlen(params->dir) + strlen(file->relname) >= FILE_MAX) { + else if (!is_parent_dir && strlen(params->dir) + strlen(file->relname) >= FILE_MAX) { // XXX error("Path too long, cannot enter this directory"); } else { - if (FILENAME_IS_PARENT(file->relname)) { + if (is_parent_dir) { /* avoids /../../ */ BLI_parent_dir(params->dir); } |