From 6f3a9031f7b93e7c687edde646beed9f02d920d4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Oct 2020 01:19:24 +1000 Subject: 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. --- source/blender/blenkernel/BKE_appdir.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/BKE_appdir.h') 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); -- cgit v1.2.3