mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Push and pop for-block every run through the loop
We do the same in while loops. This clears the local variables every time. Fixes #10525
This commit is contained in:
@@ -43,3 +43,13 @@ end
|
||||
# CHECK: foo set
|
||||
# CHECK: foo set
|
||||
# CHECK: foo set
|
||||
|
||||
for x in 1 2 3
|
||||
test $x -eq 2 && set -l foo bar
|
||||
echo foo value is $foo
|
||||
end
|
||||
# We keep the old value from outside the loop
|
||||
# CHECK: foo value is 3
|
||||
# CHECK: foo set
|
||||
# CHECK: foo value is bar
|
||||
# CHECK: foo value is 3
|
||||
|
||||
Reference in New Issue
Block a user