mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
If no uvars are available, fall back to global when setting
Otherwise `set -U foo bar` if uvars aren't available would simply not set *anything*.
This commit is contained in:
@@ -1170,10 +1170,12 @@ mod_result_t env_stack_impl_t::set(const wcstring &key, env_mode_flags_t mode,
|
||||
mod_result_t result{ENV_OK};
|
||||
if (query.has_scope) {
|
||||
// The user requested a particular scope.
|
||||
if (query.universal) {
|
||||
//
|
||||
// If we don't have uvars, fall back to using globals
|
||||
if (query.universal && uvars()) {
|
||||
set_universal(key, std::move(val), query);
|
||||
result.uvar_modified = true;
|
||||
} else if (query.global) {
|
||||
} else if (query.global || (query.universal && !uvars())) {
|
||||
set_in_node(globals_, key, std::move(val), flags);
|
||||
result.global_modified = true;
|
||||
} else if (query.local) {
|
||||
|
||||
Reference in New Issue
Block a user