mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
remove more ENV_NULL references
This commit is contained in:
parent
82b5ba1af4
commit
74f0be2a53
|
@ -293,8 +293,6 @@ static int my_env_set(const wchar_t *cmd, const wchar_t *key, const wcstring_lis
|
|||
if (retval != STATUS_CMD_OK) return retval;
|
||||
}
|
||||
|
||||
// We don't check `val->empty()` because an array var with a single empty string will be
|
||||
// "empty". A truly empty array var is set to the special value `ENV_NULL`.
|
||||
auto val = list_to_array_val(list);
|
||||
retval = env_set(key, val->c_str(), scope | ENV_USER);
|
||||
switch (retval) {
|
||||
|
|
|
@ -1172,16 +1172,8 @@ static void expand_home_directory(wcstring &input) {
|
|||
if (username.empty()) {
|
||||
// Current users home directory.
|
||||
home = env_get(L"HOME");
|
||||
// If home is either missing or empty,
|
||||
// treat it like an empty list.
|
||||
// $HOME is defined to be a _path_,
|
||||
// and those cannot be empty.
|
||||
//
|
||||
// We do not expand a string-empty var differently,
|
||||
// because that results in bogus paths
|
||||
// - ~/foo turns into /foo.
|
||||
if (home.missing_or_empty()) {
|
||||
input = ENV_NULL;
|
||||
input.clear();
|
||||
return;
|
||||
}
|
||||
tail_idx = 1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user