diff options
author | Stefan Farfeleder <stefanf@FreeBSD.org> | 2007-10-04 16:14:48 +0000 |
---|---|---|
committer | Stefan Farfeleder <stefanf@FreeBSD.org> | 2007-10-04 16:14:48 +0000 |
commit | aafd6a87a63e6362a1cd214c9c6df4caa20973ed (patch) | |
tree | bb55e154819f0464678c1f725aef74d0bc98283b /tools | |
parent | 265e8a9acccfc1b6f90f9654c03d297f3ed2d150 (diff) | |
download | src-aafd6a87a63e6362a1cd214c9c6df4caa20973ed.tar.gz src-aafd6a87a63e6362a1cd214c9c6df4caa20973ed.zip |
The exit status of a case statement where none of the patterns is matched
is supposed to be 0, not the status of the previous command.
Reported by: Eygene Ryabinkin
PR: 116559
Approved by: re (gnn)
Notes
Notes:
svn path=/head/; revision=172440
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/builtins/case1.0 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/case1.0 b/tools/regression/bin/sh/builtins/case1.0 new file mode 100644 index 000000000000..860fc67dacda --- /dev/null +++ b/tools/regression/bin/sh/builtins/case1.0 @@ -0,0 +1,13 @@ +#$FreeBSD$ +f() +{ + false + case $1 in + foo) true ;; + bar) false ;; + esac +} + +f foo || exit 1 +f bar && exit 1 +f quux || exit 1 |