Skip to content

Fix $&if to run "elses" like "thens", not "tests"#180

Merged
jpco merged 1 commit intowryun:masterfrom
jpco:if-fix
Apr 8, 2025
Merged

Fix $&if to run "elses" like "thens", not "tests"#180
jpco merged 1 commit intowryun:masterfrom
jpco:if-fix

Conversation

@jpco
Copy link
Collaborator

@jpco jpco commented Apr 7, 2025

Found while looking at #73; if "turns off" the exit-on-false behavior when running each test, but the current behavior has it also do so while running the else command, which seems pretty clearly wrong.

if {false} {
  command which will not run
} {
  commands that might
  be risky
  don''''t you want
  some -e protection here?
}

The fact that this has never been reported before is, along with the fact that the bodies of while loops run with eval_exitonfalse toggled off, is pretty compelling evidence to me that nobody ever uses -e...

@jpco jpco added the bug label Apr 8, 2025
@jpco jpco merged commit dd87795 into wryun:master Apr 8, 2025
1 check passed
@jpco jpco deleted the if-fix branch April 8, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant