diff options
author | Kevin Ballard <kevin@sb.org> | 2014-10-01 12:33:30 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-10-01 12:35:15 -0700 |
commit | 43e451d4d8dbc96c853d9297065322457ac9c345 (patch) | |
tree | 68ee1df33e3a5868083e4c72cc1d98c2f3c41405 /env.cpp | |
parent | 1be5e68e994b72ff60aa6221420761fe0f7271a2 (diff) |
Find fishd file even when $HOME is unset
env.cpp sets up $HOME based on the current user, if it's not inherited
from the environment. fishd_get_config should be using the same
calculated value of $HOME. To that end, move universal variable
initialization to after $HOME is set up, and read the value from the
fish environment instead of using getenv().
Fixes #1725.
Diffstat (limited to 'env.cpp')
-rw-r--r-- | env.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -530,11 +530,6 @@ void env_init(const struct config_paths_t *paths /* or NULL */) env_set(L"version", version.c_str(), ENV_GLOBAL); env_set(L"FISH_VERSION", version.c_str(), ENV_GLOBAL); - /* Set up universal variables. The empty string means to use the deafult path. */ - assert(s_universal_variables == NULL); - s_universal_variables = new env_universal_t(L""); - s_universal_variables->load(); - /* Set up SHLVL variable */ @@ -570,6 +565,11 @@ void env_init(const struct config_paths_t *paths /* or NULL */) /* Set PWD */ env_set_pwd(); + /* Set up universal variables. The empty string means to use the deafult path. */ + assert(s_universal_variables == NULL); + s_universal_variables = new env_universal_t(L""); + s_universal_variables->load(); + /* Set g_log_forks */ env_var_t log_forks = env_get_string(L"fish_log_forks"); g_log_forks = ! log_forks.missing_or_empty() && from_string<bool>(log_forks); |