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:
authorCampbell Barton <ideasman42@gmail.com>2021-11-01 05:09:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-11-01 05:11:48 +0300
commita0633e2484f21c9f80842c10b46b3af98b54d25a (patch)
treeb19b840f0eb683a9cb371cc5b1f275056db05a03 /source/blender/blenkernel/BKE_appdir.h
parentd4d38e8a34e59c8762034073b084ed3c5ee09af8 (diff)
Fix crash when "HOME" environment variable isn't defined
Accessing the default directory in the file selector would crash if HOME was undefined. Add BKE_appdir_folder_default_or_root which never returns NULL.
Diffstat (limited to 'source/blender/blenkernel/BKE_appdir.h')
-rw-r--r--source/blender/blenkernel/BKE_appdir.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
index 07132201e87..65485058dd7 100644
--- a/source/blender/blenkernel/BKE_appdir.h
+++ b/source/blender/blenkernel/BKE_appdir.h
@@ -21,6 +21,8 @@
#include <stddef.h>
+#include "BLI_compiler_attrs.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,7 +34,9 @@ void BKE_appdir_exit(void);
/* 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_default(void) ATTR_WARN_UNUSED_RESULT;
+const char *BKE_appdir_folder_root(void) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL;
+const char *BKE_appdir_folder_default_or_root(void) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL;
const char *BKE_appdir_folder_home(void);
bool BKE_appdir_folder_documents(char *dir);
bool BKE_appdir_folder_caches(char *r_path, size_t path_len);