diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-03 18:19:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-04 01:33:14 +0300 |
commit | 6f3a9031f7b93e7c687edde646beed9f02d920d4 (patch) | |
tree | 3ba8709e633b85668e756341167cbb82f9897397 /source/blender/blenkernel/BKE_appdir.h | |
parent | d8c3ad6f986a8996f99d81a2cad735a8bfc9b3e1 (diff) |
Cleanup: BKE_appdir left paths set even when not found
Internally appdir functions would test if a path exists,
returning false if it doesn't, leaving the string set instead
of clearing it.
This is error prone as invalid paths could be used accidentally.
Since BKE_appdir_folder_id_user_notest & BKE_appdir_folder_id_version
depend on this, add a 'check_is_dir' argument so the path can be used
even when the directory can't be found.
Diffstat (limited to 'source/blender/blenkernel/BKE_appdir.h')
-rw-r--r-- | source/blender/blenkernel/BKE_appdir.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h index 09d74c16bc8..8e63631b9d5 100644 --- a/source/blender/blenkernel/BKE_appdir.h +++ b/source/blender/blenkernel/BKE_appdir.h @@ -28,14 +28,16 @@ struct ListBase; /* note on naming: typical _get() suffix is omitted here, * since its the main purpose of the API. */ const char *BKE_appdir_folder_default(void); -const char *BKE_appdir_folder_id_ex(const int folder_id, - const char *subfolder, - char *path, - size_t path_len); +bool BKE_appdir_folder_id_ex(const int folder_id, + const char *subfolder, + char *path, + size_t path_len); const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder); const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfolder); const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder); -const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check); +const char *BKE_appdir_folder_id_version(const int folder_id, + const int ver, + const bool check_is_dir); bool BKE_appdir_app_is_portable_install(void); bool BKE_appdir_app_template_any(void); |