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/editors/space_file/file_ops.c
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/editors/space_file/file_ops.c')
-rw-r--r--source/blender/editors/space_file/file_ops.c6
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 f647e1d4e4f..a83e1974baf 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2463,12 +2463,14 @@ static void file_expand_directory(bContext *C)
if (BLI_path_is_rel(params->dir)) {
/* Use of 'default' folder here is just to avoid an error message on '//' prefix. */
BLI_path_abs(params->dir,
- G.relbase_valid ? BKE_main_blendfile_path(bmain) : BKE_appdir_folder_default());
+ G.relbase_valid ? BKE_main_blendfile_path(bmain) :
+ BKE_appdir_folder_default_or_root());
}
else if (params->dir[0] == '~') {
char tmpstr[sizeof(params->dir) - 1];
BLI_strncpy(tmpstr, params->dir + 1, sizeof(tmpstr));
- BLI_join_dirfile(params->dir, sizeof(params->dir), BKE_appdir_folder_default(), tmpstr);
+ BLI_path_join(
+ params->dir, sizeof(params->dir), BKE_appdir_folder_default_or_root(), tmpstr, NULL);
}
else if (params->dir[0] == '\0')