mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Fix local-exported vars with "--no-scope-shadowing"
This used to create copies even then, which meant it couldn't modify them.
This commit is contained in:
parent
04205f36be
commit
415c7ebbcc
1 changed files with 7 additions and 5 deletions
|
@ -182,6 +182,7 @@ void var_stack_t::push(bool new_scope) {
|
||||||
|
|
||||||
// Copy local-exported variables
|
// Copy local-exported variables
|
||||||
auto top_node = top.get();
|
auto top_node = top.get();
|
||||||
|
if (new_scope) {
|
||||||
if (!(top_node == this->global_env)) {
|
if (!(top_node == this->global_env)) {
|
||||||
for (auto& var : top_node->env) {
|
for (auto& var : top_node->env) {
|
||||||
if (var.second.exportv) {
|
if (var.second.exportv) {
|
||||||
|
@ -190,6 +191,7 @@ void var_stack_t::push(bool new_scope) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
node->next = std::move(this->top);
|
node->next = std::move(this->top);
|
||||||
this->top = std::move(node);
|
this->top = std::move(node);
|
||||||
|
|
Loading…
Reference in a new issue