sh: Fix some bugs with exit status from case containing ;&.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:04:53 +0000 (12:04 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:48:20 +0000 (12:48 -0800)
commitb88d2fafe2e2a6d776e70cb6d6cca1533087b699
treedbfc87676011f188f21139feb03794152b3d351e
parentc79cd3b3a40bbcea12f869fee83c021fc6c8bf90
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
bin/sh/eval.c
tools/regression/bin/sh/builtins/case17.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case18.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case19.0 [new file with mode: 0644]