From 31c6cfca9cc665feae46f4680687e902ad1bf9d7 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 13 Oct 2016 11:30:32 +0200 Subject: 39625: case needs to reset lastval if no pattern matched --- Test/A01grammar.ztst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test/A01grammar.ztst') diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 0e77f3ebc..e4b6870d7 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -763,6 +763,23 @@ ;; esac 0:case retains exit status for execution of cases +>37 + + false + case stuff in + (nomatch) foo + ;; + esac + echo $? +0:case sets exit status to zero if no patterns are matched +>0 + + case match in + (match) true; false; (exit 37) + ;; + esac + echo $? +0:case keeps exit status of last command executed in compound-list >37 x=1 -- cgit 1.4.1