From da86d6b4f2c3eef5b1f0860c9dae433f3a540951 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 9 Feb 2015 16:39:29 +0000 Subject: 34485: More rationalisation for anonymous functions. Don't attempt to treat as "simple" case as there are too many hidden problems. Pull out some post-execution functions to a common case in execcmd(). --- Test/E01options.ztst | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'Test') diff --git a/Test/E01options.ztst b/Test/E01options.ztst index 46b183776..32135344f 100644 --- a/Test/E01options.ztst +++ b/Test/E01options.ztst @@ -783,14 +783,24 @@ >print is a shell builtin ?(eval):8: command not found: print -# This option seems to be problematic. I don't quite know how it works. -## func() { -## setopt localoptions printexitvalue -## false -## } -## func -## 1:PRINT_EXIT_VALUE option -## ?(eval):2: exit 1 +# PRINTEXITVALUE only works if shell input is coming from standard input. +# Goodness only knows why. + $ZTST_testdir/../Src/zsh -f <<<' + setopt printexitvalue + func() { + false + } + func + ' +1:PRINT_EXIT_VALUE option +?zsh: exit 1 + + $ZTST_testdir/../Src/zsh -f <<<' + setopt printexitvalue + () { false; } + ' +1:PRINT_EXIT_VALUE option for anonymous function +?zsh: exit 1 setopt promptbang print -P ! -- cgit 1.4.1