git: DragonFly_RELEASE_3_0 sh: Fix two bugs with case and exit status:

Peter Avalos pavalos at crater.dragonflybsd.org
Sun Feb 5 13:05:22 PST 2012


commit d5beb8994c44107c3b207ae708c92dee6ef81740
Author: Peter Avalos <pavalos at dragonflybsd.org>
Date:   Sun Feb 5 12:02:44 2012 -0800

    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
    (cherry picked from commit c79cd3b3a40bbcea12f869fee83c021fc6c8bf90)

Summary of changes:
 bin/sh/eval.c                             |    6 ++++--
 tools/regression/bin/sh/builtins/case14.0 |    5 +++++
 tools/regression/bin/sh/builtins/case15.0 |    5 +++++
 tools/regression/bin/sh/builtins/case16.0 |    7 +++++++
 4 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 tools/regression/bin/sh/builtins/case14.0
 create mode 100644 tools/regression/bin/sh/builtins/case15.0
 create mode 100644 tools/regression/bin/sh/builtins/case16.0

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d5beb8994c44107c3b207ae708c92dee6ef81740


-- 
DragonFly BSD source repository





More information about the Commits mailing list