From 9e38ab81785c4ac755a7e78d2fe7a7db92bdf375 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 6 May 2021 10:03:27 +0100 Subject: 48787: Fix command status after failed if If "if" had a hard error in the condition, and there was no else clause, the command status was incorrectly cleared to zero. Add test. --- Test/A01grammar.ztst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Test') diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 35a04e7d5..88fc8606e 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -939,3 +939,8 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci $ZTST_testdir/../Src/zsh -fc '{ ( ) } always { echo foo }' 0:exec last command optimization inhibited for try/always >foo + + a='${' + if : ${(e)a}; then echo x; fi +1:Status on bad substitution in if without else +?(eval):2: bad substitution -- cgit 1.4.1