From a0633e2484f21c9f80842c10b46b3af98b54d25a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 1 Nov 2021 13:09:02 +1100 Subject: 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. --- source/blender/blenlib/BLI_winstuff.h | 2 +- source/blender/blenlib/intern/winstuff.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index bf09b56c779..cbf1716602a 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -106,7 +106,7 @@ const char *dirname(char *path); /* Windows utility functions. */ bool BLI_windows_register_blend_extension(const bool background); -void BLI_windows_get_default_root_dir(char *root_dir); +void BLI_windows_get_default_root_dir(char root_dir[4]); int BLI_windows_get_executable_dir(char *str); #ifdef __cplusplus diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 3001b25bc1e..11345fc7242 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -193,7 +193,7 @@ bool BLI_windows_register_blend_extension(const bool background) return true; } -void BLI_windows_get_default_root_dir(char *root) +void BLI_windows_get_default_root_dir(char root[4]) { char str[MAX_PATH + 1]; -- cgit v1.2.3