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:
Fabian Boehm
2024-05-25 13:17:35 +02:00
parent 6921394db2
commit bf9e5583ba
2 changed files with 14 additions and 2 deletions

View File

@@ -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