mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-15 22:51:13 -03:00
Fix crash if $PWD is used as for-loop variable
for PWD in foo; true; end prints: >..src/parse_execution.cpp:461: end_execution_reason_t parse_execution_context_t::run_for_statement(const ast::for_header_t&, const ast::job_list_t&): Assertion `retval == ENV_OK' failed. because this used the wrong way to see if something is read-only.
This commit is contained in:
@@ -500,3 +500,11 @@ echo banana
|
||||
# This used to be a parse error - #7685.
|
||||
echo (echo hello\\)
|
||||
# CHECK: hello\
|
||||
|
||||
# Should fail because $PWD is read-only.
|
||||
for PWD in foo bar
|
||||
true
|
||||
end
|
||||
# CHECKERR: {{.*}}/basic.fish (line {{\d+}}): You cannot use read-only variable 'PWD' in a for loop
|
||||
# CHECKERR: for PWD in foo bar
|
||||
# CHECKERR: ^
|
||||
|
||||
Reference in New Issue
Block a user