git: DragonFly_RELEASE_3_0 sh: Fix some bugs with exit status from case containing ;&.
Peter Avalos
pavalos at crater.dragonflybsd.org
Sun Feb 5 13:05:22 PST 2012
commit 4181c918716ab3dbca834e418290b3f961fd9bbc
Author: Peter Avalos <pavalos at dragonflybsd.org>
Date: Sun Feb 5 12:04:53 2012 -0800
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
(cherry picked from commit b88d2fafe2e2a6d776e70cb6d6cca1533087b699)
Summary of changes:
bin/sh/eval.c | 35 ++++++++++++++++++++--------
tools/regression/bin/sh/builtins/case17.0 | 3 ++
tools/regression/bin/sh/builtins/case18.0 | 7 +++++
tools/regression/bin/sh/builtins/case19.0 | 7 +++++
4 files changed, 42 insertions(+), 10 deletions(-)
create mode 100644 tools/regression/bin/sh/builtins/case17.0
create mode 100644 tools/regression/bin/sh/builtins/case18.0
create mode 100644 tools/regression/bin/sh/builtins/case19.0
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/4181c918716ab3dbca834e418290b3f961fd9bbc
--
DragonFly BSD source repository
More information about the Commits
mailing list