sh: Fix two bugs with case and exit status:
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:02:44 +0000 (12:02 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 5 Feb 2012 20:48:17 +0000 (12:48 -0800)
commitc79cd3b3a40bbcea12f869fee83c021fc6c8bf90
treea60a29bf9b24c625a175b4f8b4400c79a3e62811
parent43cdc26c9fc6fb1e385f2d3238bcb96c3e5ea221
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
bin/sh/eval.c
tools/regression/bin/sh/builtins/case14.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case15.0 [new file with mode: 0644]
tools/regression/bin/sh/builtins/case16.0 [new file with mode: 0644]