mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-05 07:04:27 +08:00
Persist new zero-length universal variables
Because of default initialization to an empty list, code that relies on set -U __fish_init_3_x was run every time.
This commit is contained in:
parent
0b1af1ace4
commit
3f10da0d01
@ -268,8 +268,9 @@ maybe_t<env_var_t::env_var_flags_t> env_universal_t::get_flags(const wcstring &n
|
||||
|
||||
void env_universal_t::set_internal(const wcstring &key, const env_var_t &var) {
|
||||
ASSERT_IS_LOCKED(lock);
|
||||
bool new_entry = vars.count(key) == 0;
|
||||
env_var_t &entry = vars[key];
|
||||
if (entry != var) {
|
||||
if (new_entry || entry != var) {
|
||||
entry = var;
|
||||
this->modified.insert(key);
|
||||
if (entry.exports()) export_generation += 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user