From 7dc3b250aaa5e54527c6bb8f1feb116eca8f7fb2 Mon Sep 17 00:00:00 2001 From: stefanf Date: Thu, 4 Oct 2007 16:14:48 +0000 Subject: 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) --- tools/regression/bin/sh/builtins/case1.0 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/regression/bin/sh/builtins/case1.0 (limited to 'tools') diff --git a/tools/regression/bin/sh/builtins/case1.0 b/tools/regression/bin/sh/builtins/case1.0 new file mode 100644 index 0000000..860fc67 --- /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 -- cgit v1.1