723ecb59 | 05-Feb-2012 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Fix $? in the first command of a 'for'.
In the first command of a 'for', $? should be the exit status of the last pipeline (command substitution in the word list or command before 'for'), not al
sh: Fix $? in the first command of a 'for'.
In the first command of a 'for', $? should be the exit status of the last pipeline (command substitution in the word list or command before 'for'), not always 0.
Obtained-from: FreeBSD 230463
show more ...
|
a1cf61ab | 05-Feb-2012 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Fix execution of multiple statements in a trap when evalskip is set
Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when:
sh: Fix execution of multiple statements in a trap when evalskip is set
Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort
Obtained-from: FreeBSD 230212
show more ...
|
b88d2faf | 05-Feb-2012 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Fix some bugs with exit status from case containing ;&.
Also, rework evalcase() to not evaluate any tree. Instead, return the NCLISTFALLTHRU node and handle it in evaltree().
Fixed bugs:
* If
sh: Fix some bugs with exit status from case containing ;&.
Also, rework evalcase() to not evaluate any tree. Instead, return the NCLISTFALLTHRU node and handle it in evaltree().
Fixed bugs:
* If a ;& list with non-zero exit status is followed by an empty ;; or final list, the exit status of the case command should be equal to the exit status of the ;& list, not 0.
* An empty ;& case should not reset $?.
Obtained-from: FreeBSD 230161
show more ...
|
c79cd3b3 | 05-Feb-2012 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Fix two bugs with case and exit status:
* If no pattern is matched, POSIX says the exit status shall be 0 (even if there are command substitutions). * If a pattern is matched and there are no
sh: Fix two bugs with case and exit status:
* If no pattern is matched, POSIX says the exit status shall be 0 (even if there are command substitutions). * If a pattern is matched and there are no command substitutions, the first command should see the $? from before the case command, not always 0.
Obtained-from: FreeBSD 230154
show more ...
|
dbdce6a7 | 25-Dec-2011 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Test that . /dev/null returns exit status 0 and does not preserve $?.
Preserving $? may cause problems particularly if set -e is in effect.
It may be useful to preserve the old value of $? in t
sh: Test that . /dev/null returns exit status 0 and does not preserve $?.
Preserving $? may cause problems particularly if set -e is in effect.
It may be useful to preserve the old value of $? in the dot script but this must not be implemented in such a way that it would break this test.
Obtained-from: FreeBSD 219390
show more ...
|
c7e5ca91 | 25-Dec-2011 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Add test for exit status of for loop without items.
POSIX says the exit status of a for loop without any items shall be 0. There are no exceptions if the exit status of the previous command was
sh: Add test for exit status of for loop without items.
POSIX says the exit status of a for loop without any items shall be 0. There are no exceptions if the exit status of the previous command was not 0 or if the item list contains a command substitution with non-zero exit status.
Obtained-from: FreeBSD 226892
show more ...
|
21f23b60 | 21-Aug-2011 |
Peter Avalos <pavalos@dragonflybsd.org> |
sh: Add case statement fallthrough (with ';&' instead of ';;').
Replacing ;; with the new control operator ;& will cause the next list to be executed as well without checking its pattern, continuing
sh: Add case statement fallthrough (with ';&' instead of ';;').
Replacing ;; with the new control operator ;& will cause the next list to be executed as well without checking its pattern, continuing until a list ends with ;; or until the end of the case statement. This is like omitting "break" in a C "switch" statement.
The sequence ;& was formerly invalid.
This feature is proposed for the next POSIX issue in Austin Group issue #449.
Obtained-from: FreeBSD 223186
show more ...
|