|
@@ -819,13 +819,13 @@ static std::string GetHomeDir()
|
|
|
{
|
|
|
#ifdef __HAIKU__
|
|
|
BPath path;
|
|
|
find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
|
|
return std::string(path.Path());
|
|
|
#else
|
|
|
const char *home_env = getenv("HOME"); // Stack var, shouldn't be freed
|
|
|
const char *home_env = std::getenv("HOME"); // Stack var, shouldn't be freed
|
|
|
if (home_env != nullptr) return std::string(home_env);
|
|
|
|
|
|
const struct passwd *pw = getpwuid(getuid());
|
|
|
if (pw != nullptr) return std::string(pw->pw_dir);
|
|
|
#endif
|
|
|
return {};
|
|
@@ -837,13 +837,13 @@ static std::string GetHomeDir()
|
|
|
*/
|
|
|
void DetermineBasePaths(const char *exe)
|
|
|
{
|
|
|
std::string tmp;
|
|
|
const std::string homedir = GetHomeDir();
|
|
|
#ifdef USE_XDG
|
|
|
const char *xdg_data_home = getenv("XDG_DATA_HOME");
|
|
|
const char *xdg_data_home = std::getenv("XDG_DATA_HOME");
|
|
|
if (xdg_data_home != nullptr) {
|
|
|
tmp = xdg_data_home;
|
|
|
tmp += PATHSEP;
|
|
|
tmp += PERSONAL_DIR[0] == '.' ? &PERSONAL_DIR[1] : PERSONAL_DIR;
|
|
|
AppendPathSeparator(tmp);
|
|
|
_searchpaths[SP_PERSONAL_DIR_XDG] = tmp;
|
|
@@ -968,13 +968,13 @@ void DeterminePaths(const char *exe, boo
|
|
|
DetermineBasePaths(exe);
|
|
|
FillValidSearchPaths(only_local_path);
|
|
|
|
|
|
#ifdef USE_XDG
|
|
|
std::string config_home;
|
|
|
const std::string homedir = GetHomeDir();
|
|
|
const char *xdg_config_home = getenv("XDG_CONFIG_HOME");
|
|
|
const char *xdg_config_home = std::getenv("XDG_CONFIG_HOME");
|
|
|
if (xdg_config_home != nullptr) {
|
|
|
config_home = xdg_config_home;
|
|
|
config_home += PATHSEP;
|
|
|
config_home += PERSONAL_DIR[0] == '.' ? &PERSONAL_DIR[1] : PERSONAL_DIR;
|
|
|
} else if (!homedir.empty()) {
|
|
|
/* Defaults to ~/.config */
|