Make while loops evaluate to the last executed command status

A while loop now evaluates to the last executed command in the body, or
zero if the loop body is empty. This matches POSIX semantics.

Add a bunch of tricky tests.

See #4982
This commit is contained in:
ridiculousfish
2019-01-20 16:37:20 -08:00
parent fec10830d3
commit 1680b741b2
5 changed files with 88 additions and 21 deletions

View File

@@ -0,0 +1,3 @@
####################
# Loops exit status handling