hush/shell/hush_test/hush-misc
Denys Vlasenko eb17b6f6c9 ash: eval: Return status in eval functions
Backported from dash:

    eval: Return status in eval functions

    The exit status is currently clobbered too early for case statements
    and loops.  This patch fixes it by making the eval functions return
    the current exit status and setting them in one place -- evaltree.

    Harald van Dijk pointed out a number of bugs in the original patch.

function                                             old     new   delta
evalcommand                                         1226    1242     +16
cmdloop                                              383     398     +15
evalfor                                              223     227      +4
evalcase                                             271     275      +4
localcmd                                             348     350      +2
evaltreenr                                           927     928      +1
evaltree                                             927     928      +1
evalsubshell                                         150     151      +1
evalpipe                                             356     357      +1
parse_command                                       1585    1584      -1
evalloop                                             177     164     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 9/2 up/down: 45/-14)             Total: 31 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-09-28 19:41:57 +02:00
..
and-or.right
and-or.tests
assignment1.right
assignment1.tests
assignment2.rigth
assignment2.tests
assignment3.right hush: fix improper handling of newline and hash chars in few corner cases 2010-11-22 17:58:14 +01:00
assignment3.tests hush: fix improper handling of newline and hash chars in few corner cases 2010-11-22 17:58:14 +01:00
assignment4.right hush: fix misparsing of "... do eval a= ...". Closes 3721 2011-05-14 11:27:36 +02:00
assignment4.tests hush: fix misparsing of "... do eval a= ...". Closes 3721 2011-05-14 11:27:36 +02:00
break1.right
break1.tests *: trailing empty lines removed 2010-07-26 01:49:12 +02:00
break2.right
break2.tests
break3.right
break3.tests
break4.right
break4.tests
break5.right
break5.tests
builtin1.right
builtin1.tests
case1.right hush: fix problems with case in subshells and with "case esac" 2009-05-23 16:50:07 +02:00
case1.tests hush: fix problems with case in subshells and with "case esac" 2009-05-23 16:50:07 +02:00
colon.right
colon.tests
compound.right hush_test: add some pathological compound list tests 2009-05-21 18:35:37 -04:00
compound.tests make compound.tests executable 2009-05-23 17:00:13 +02:00
continue1.right
continue1.tests
continue2.right
continue2.tests
continue3.right
continue3.tests
echo_write_error.right echo: do not retry on write errors 2011-02-07 02:03:51 +01:00
echo_write_error.tests echo: do not retry on write errors 2011-02-07 02:03:51 +01:00
empty_args.right hush: fix handling of empty arguments 2009-10-18 11:46:35 +02:00
empty_args.tests hush: fix handling of empty arguments 2009-10-18 11:46:35 +02:00
empty_for2.right
empty_for2.tests
empty_for.right
empty_for.tests
env_and_func.right hush: fix bug where in "var=val func" var's value is not visible in func 2009-05-04 00:14:30 +02:00
env_and_func.tests hush: fix bug where in "var=val func" var's value is not visible in func 2009-05-04 00:14:30 +02:00
exec.right
exec.tests hush: heredoc support, based on patch by Mike Frysinger (vapier AT gentoo.org) 2009-04-07 02:29:51 +00:00
exit1.right hush: fix EXIT trap recursion case; check redirection failures 2009-04-09 13:43:11 +00:00
exit1.tests hush: fix EXIT trap recursion case; check redirection failures 2009-04-09 13:43:11 +00:00
exitcode1.right ash: eval: Return status in eval functions 2016-09-28 19:41:57 +02:00
exitcode1.tests ash: eval: Return status in eval functions 2016-09-28 19:41:57 +02:00
export-n.right hush: export -n support 2009-04-20 22:04:21 +00:00
export-n.tests hush: export -n support 2009-04-20 22:04:21 +00:00
export.right hush: fix handling of } which is not a closing one in { cmd; } 2009-04-19 13:57:51 +00:00
export.tests hush: fix some TODOs. TODO in export builting: +250 bytes. 2009-04-10 13:49:10 +00:00
for_with_bslashes.right hush: tighten up "for" variable name check. 2009-04-10 12:03:20 +00:00
for_with_bslashes.tests hush: tighten up "for" variable name check. 2009-04-10 12:03:20 +00:00
for_with_keywords.right
for_with_keywords.tests
for.right hush: copy for.tests from ash testsuite 2015-10-29 22:37:25 +01:00
for.tests hush: copy for.tests from ash testsuite 2015-10-29 22:37:25 +01:00
func1.right hush: add function tests 2009-04-10 23:23:41 +00:00
func1.tests hush: add function tests 2009-04-10 23:23:41 +00:00
func2.right hush: add function tests 2009-04-10 23:23:41 +00:00
func2.tests hush: add function tests 2009-04-10 23:23:41 +00:00
func3.right hush: return builtin by Bayram Kurumahmut (kbayram AT ubicom.com) 2009-04-17 23:44:18 +00:00
func3.tests hush: return builtin by Bayram Kurumahmut (kbayram AT ubicom.com) 2009-04-17 23:44:18 +00:00
func4.right hush: nommu fix for function passing 2009-04-26 20:06:14 +00:00
func4.tests whitespace fixes 2010-01-25 13:39:24 +01:00
func5.right hush_test: test for subshell function syntax 2009-05-21 18:35:08 -04:00
func5.tests hush_test: test for subshell function syntax 2009-05-21 18:35:08 -04:00
func_args1.right hush: add two testcases 2009-04-20 10:52:31 +00:00
func_args1.tests hush-misc/func_args1.tests: remove "UNFIXED BUG", it does not fail 2015-11-04 14:50:19 +01:00
func_local1.right hush: add support for local builtin 2009-06-03 12:47:26 +02:00
func_local1.tests hush: add support for local builtin 2009-06-03 12:47:26 +02:00
func_local2.right hush: add support for local builtin 2009-06-03 12:47:26 +02:00
func_local2.tests hush: add support for local builtin 2009-06-03 12:47:26 +02:00
heredoc1.right hush: heredoc support, based on patch by Mike Frysinger (vapier AT gentoo.org) 2009-04-07 02:29:51 +00:00
heredoc1.tests hush: heredoc support, based on patch by Mike Frysinger (vapier AT gentoo.org) 2009-04-07 02:29:51 +00:00
heredoc2.right hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
heredoc2.tests hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
heredoc3.right hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
heredoc3.tests hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
heredoc_backslash1.right hush: fix handling of \" in quoted/unquoted cmd 2010-09-12 15:05:39 +02:00
heredoc_backslash1.tests hush: fix handling of \" in quoted/unquoted cmd 2010-09-12 15:05:39 +02:00
heredoc_huge.right hush: more rodust detection of unterminated strings etc; 2009-04-08 21:51:33 +00:00
heredoc_huge.tests hush: more rodust detection of unterminated strings etc; 2009-04-08 21:51:33 +00:00
if_false_exitcode.right hush: fix "if false; then...fi" exitcode; 2009-04-06 18:40:31 +00:00
if_false_exitcode.tests hush: fix "if false; then...fi" exitcode; 2009-04-06 18:40:31 +00:00
nommu1.right hush: fix \<newline> handling on NOMMU 2009-08-12 19:47:44 +02:00
nommu1.tests hush: fix \<newline> handling on NOMMU 2009-08-12 19:47:44 +02:00
nommu2.right hush: two NOMMU fixes for bugs 877 and 883 2010-01-12 13:45:45 +01:00
nommu2.tests hush: two NOMMU fixes for bugs 877 and 883 2010-01-12 13:45:45 +01:00
nommu3.right hush: fix a nommu bug where a part of function body is lost if run in a pipe 2015-09-04 06:22:10 +02:00
nommu3.tests typo fix 2015-10-13 01:49:06 +02:00
opts1.right hush: do not process options after non-option args 2009-08-20 03:38:58 +02:00
opts1.tests hush: do not process options after non-option args 2009-08-20 03:38:58 +02:00
pid.right
pid.tests
pipefail.right hush: add support for "set -o pipefail" 2010-11-14 02:01:50 +01:00
pipefail.tests hush: add support for "set -o pipefail" 2010-11-14 02:01:50 +01:00
read.right
read.tests
redir1.right hush: readability improvements. 2009-04-10 00:20:58 +00:00
redir1.tests hush: tighten up "for" variable name check. 2009-04-10 12:03:20 +00:00
redir2.right hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
redir2.tests hush: echo \2>file fix 2009-04-08 09:29:14 +00:00
redir3.right hush: fix EXIT trap recursion case; check redirection failures 2009-04-09 13:43:11 +00:00
redir3.tests hush: fix EXIT trap recursion case; check redirection failures 2009-04-09 13:43:11 +00:00
redir4.right hush: tighten up "for" variable name check. 2009-04-10 12:03:20 +00:00
redir4.tests hush: tighten up "for" variable name check. 2009-04-10 12:03:20 +00:00
redir5.right hush: fix stdin of backgrounded pipe 2009-04-20 00:34:01 +00:00
redir5.tests hush: fix stdin of backgrounded pipe 2009-04-20 00:34:01 +00:00
redir6.right hush: fix multiple redirections of the same fd (bug 227) 2009-05-02 14:17:31 +02:00
redir6.tests hush: fix multiple redirections of the same fd (bug 227) 2009-05-02 14:17:31 +02:00
redir_script.right hush: fix "redirects can close script fd" bug 2016-08-22 19:54:12 +02:00
redir_script.tests hush: fix "redirects can close script fd" bug 2016-08-22 19:54:12 +02:00
return1.right hush: fix a case where return in sourced file has no effect 2011-03-24 02:50:03 +01:00
return1.tests hush: fix a case where return in sourced file has no effect 2011-03-24 02:50:03 +01:00
shift.right
shift.tests
sig_exitcode.right hush: fix exitcodes of killed processes 2010-01-04 11:37:09 +01:00
sig_exitcode.tests hush: fix exitcodes of killed processes 2010-01-04 11:37:09 +01:00
sigint1.right ash: fix ash-signals/signal8 testcase failure 2011-02-21 03:22:20 +01:00
sigint1.tests slightly better wording in comments 2011-02-21 03:47:50 +01:00
source1.right hush: document a bug about aborting on sourced file error when non-interactive 2011-03-24 05:38:51 +01:00
source1.tests hush: document a bug about aborting on sourced file error when non-interactive 2011-03-24 05:38:51 +01:00
source2.right hush: source builtin should override $N only if it has args 2013-03-17 14:11:04 +01:00
source2.tests hush: source builtin should override $N only if it has args 2013-03-17 14:11:04 +01:00
syntax_err_negate.right
syntax_err_negate.tests
syntax_err.right
syntax_err.tests
unicode1.right hush: make ${#var} unicode-aware 2014-08-13 09:57:44 +02:00
unicode1.tests hush: make ${#var} unicode-aware 2014-08-13 09:57:44 +02:00
until1.right
until1.tests
while1.right
while1.tests
while2.right
while2.tests
while3.right hush: fix a corner case of empty "do \n done" structure 2011-05-31 17:35:45 +02:00
while3.tests hush: fix a corner case of empty "do \n done" structure 2011-05-31 17:35:45 +02:00
while4.right hush: fix for "while false && true; do echo BUG; break; done". closes 6170 2013-04-07 18:16:58 +02:00
while4.tests hush: fix for "while false && true; do echo BUG; break; done". closes 6170 2013-04-07 18:16:58 +02:00
while_in_subshell.right
while_in_subshell.tests