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

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


commit c79cd3b3a40bbcea12f869fee83c021fc6c8bf90
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

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/c79cd3b3a40bbcea12f869fee83c021fc6c8bf90


-- 
DragonFly BSD source repository





More information about the Commits mailing list