diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-02-15 02:33:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-02-15 02:40:41 +0300 |
commit | 1c883fe6468c9fd3859d24e63590d4011984d52e (patch) | |
tree | 1fe62d7d09a854c0d92e44b2c685b04db3ff876a /source/blender/editors/space_file/filelist.c | |
parent | 68a52a7fa9327d48f52deddd8c81cc35f4192fe0 (diff) |
Cleanup: make BLI_make_exist local to the file selector
This isn't a general utility, and the name wasn't descriptive.
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 800726c6fb0..b328b32263c 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1046,12 +1046,23 @@ int filelist_geticon(struct FileList *filelist, const int index, const bool is_m /* ********** Main ********** */ +static void parent_dir_until_exists_or_default_root(char *dir) +{ + if (!BLI_parent_dir_until_exists(dir)) { +#ifdef WIN32 + get_default_root(dir); +#else + strcpy(dir, "/"); +#endif + } +} + static bool filelist_checkdir_dir(struct FileList *UNUSED(filelist), char *r_dir, const bool do_change) { if (do_change) { - BLI_make_exist(r_dir); + parent_dir_until_exists_or_default_root(r_dir); return true; } else { @@ -1072,7 +1083,7 @@ static bool filelist_checkdir_lib(struct FileList *UNUSED(filelist), if (do_change && !is_valid) { /* if not a valid library, we need it to be a valid directory! */ - BLI_make_exist(r_dir); + parent_dir_until_exists_or_default_root(r_dir); return true; } return is_valid; |