Export $HOME if we have to calculate it

If $HOME is unset in the environment, fish calculates it with
getpwnam(). However, it wasn't being exported. Just like the $USER
calculation, $HOME should probably be exported, because everyone will
assume that it's an environment variable (as opposed to an unexported
global variable).
This commit is contained in:
Kevin Ballard 2014-10-01 12:27:32 -07:00
parent ab5b22982f
commit 1be5e68e99

View file

@ -562,7 +562,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
if (pw->pw_dir != NULL)
{
const wcstring dir = str2wcstring(pw->pw_dir);
env_set(L"HOME", dir.c_str(), ENV_GLOBAL);
env_set(L"HOME", dir.c_str(), ENV_GLOBAL | ENV_EXPORT);
}
free(unam_narrow);
}