Merge branch 'blender-v4.3-release'
This commit is contained in:
@@ -75,9 +75,17 @@ const char *GHOST_SystemPathsUnix::getUserDir(int version, const char *versionst
|
||||
else {
|
||||
home = getenv("HOME");
|
||||
if (home == nullptr) {
|
||||
home = getpwuid(getuid())->pw_dir;
|
||||
if (const passwd *pwuser = getpwuid(getuid())) {
|
||||
home = pwuser->pw_dir;
|
||||
}
|
||||
}
|
||||
|
||||
if (home) {
|
||||
user_path = string(home) + "/.config/blender/" + versionstr;
|
||||
}
|
||||
else {
|
||||
return nullptr;
|
||||
}
|
||||
user_path = string(home) + "/.config/blender/" + versionstr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,10 @@
|
||||
# endif
|
||||
/* #mkdtemp on OSX (and probably all *BSD?), not worth making specific check for this OS. */
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
# include <pwd.h> /* For `passwd` access. */
|
||||
|
||||
#endif /* !WIN32 */
|
||||
|
||||
static const char _str_null[] = "(null)";
|
||||
#define STR_OR_FALLBACK(a) ((a) ? (a) : _str_null)
|
||||
@@ -168,13 +171,26 @@ const char *BKE_appdir_folder_default_or_root()
|
||||
|
||||
const char *BKE_appdir_folder_home()
|
||||
{
|
||||
const char *home_dir = nullptr;
|
||||
|
||||
#ifdef WIN32
|
||||
return BLI_getenv("userprofile");
|
||||
#elif defined(__APPLE__)
|
||||
return BLI_expand_tilde("~/");
|
||||
home_dir = BLI_getenv("userprofile");
|
||||
#else
|
||||
return BLI_getenv("HOME");
|
||||
|
||||
# if defined(__APPLE__)
|
||||
home_dir = BLI_expand_tilde("~/");
|
||||
# endif
|
||||
if (home_dir == nullptr) {
|
||||
home_dir = BLI_getenv("HOME");
|
||||
if (home_dir == nullptr) {
|
||||
if (const passwd *pwuser = getpwuid(getuid())) {
|
||||
home_dir = pwuser->pw_dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return home_dir;
|
||||
}
|
||||
|
||||
bool BKE_appdir_folder_documents(char *dir)
|
||||
|
||||
Reference in New Issue
Block a user