hush/shell/ash_test/ash-misc
Denys Vlasenko 35ec818fa2 ash: fix "return N" not setting $? in loop conditionals
Upstream commit 1:

    Date: Mon, 6 Oct 2014 20:45:04 +0800
    [EVAL] Move common skipcount logic into skiploop

    The functions evalloop and evalfor share the logic on checking
    and updating skipcount.  This patch moves that into the helper
    function skiploop.

    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Upstream commit 2:

    Date: Mon, 6 Oct 2014 21:22:43 +0800
    [BUILTIN] Allow return in loop conditional to set exit status

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=332954

    When return is used in a loop conditional the exit status will
    be lost because we always set the exit status at the end of the
    loop to that of the last command executed in the body.

    This is counterintuitive and contrary to what most other shells do.

    This patch fixes this by always preserving the exit status of
    return when it is used in a loop conditional.

    The patch was originally written by Gerrit Pape <pape@smarden.org>.

    Reported-by: Stephane Chazelas <stephane_chazelas@yahoo.fr>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-10-01 19:56:52 +02:00
..
command2.right ash: add tests for failures of the exec and command builtins 2015-10-30 22:19:06 +01:00
command2.tests ash: add tests for failures of the exec and command builtins 2015-10-30 22:19:06 +01:00
command.right ash: respect -p flag when command builtin is run with -v/-V 2015-10-29 20:05:32 +01:00
command.tests ash: respect -p flag when command builtin is run with -v/-V 2015-10-29 20:05:32 +01:00
echo_write_error.right echo: do not retry on write errors 2011-02-07 02:03:51 +01:00
echo_write_error.tests fix file mode 2015-07-13 03:52:32 +02:00
errexit1.right ash: exit after subshell error when errexit option is set 2016-09-17 23:28:23 +02:00
errexit1.tests ash: exit after subshell error when errexit option is set 2016-09-17 23:28:23 +02:00
eval1.right ash: [EVAL] Make eval with empty arguments return 0 2016-09-29 00:30:31 +02:00
eval1.tests ash: [EVAL] Make eval with empty arguments return 0 2016-09-29 00:30:31 +02:00
eval2.right hush: fix 'eval ""' handling 2016-09-29 01:44:17 +02:00
eval2.tests hush: fix 'eval ""' handling 2016-09-29 01:44:17 +02:00
exec.right ash: add tests for failures of the exec and command builtins 2015-10-30 22:19:06 +01:00
exec.tests ash: add tests for failures of the exec and command builtins 2015-10-30 22:19:06 +01: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
for.right ash: allow newline after variable name in for loop 2015-10-29 19:30:55 +01:00
for.tests ash: allow newline after variable name in for loop 2015-10-29 19:30:55 +01:00
func1.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func1.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func2.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func2.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func3.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func3.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func4.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func4.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func5.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func5.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func6.right ash: fix "return N" not setting $? in loop conditionals 2016-10-01 19:56:52 +02:00
func6.tests ash: fix "return N" not setting $? in loop conditionals 2016-10-01 19:56:52 +02:00
func_args1.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01: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_bash1.right ash: add support for bash 'function' keyword 2015-11-04 19:30:24 +01:00
func_bash1.tests ash: add support for bash 'function' keyword 2015-11-04 19:30:24 +01:00
func_local1.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func_local1.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func_local2.right ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
func_local2.tests ash: copy function tests from hush testsuite 2015-11-04 14:48:16 +01:00
last_amp.right ash: better fix for ash -c 'echo 5&' and ash -c 'sleep 5&' 2008-11-28 03:41:47 +00:00
last_amp.tests ash: better fix for ash -c 'echo 5&' and ash -c 'sleep 5&' 2008-11-28 03:41:47 +00:00
local1.right ash: make "locak VAR" unset VAR (bash does that) 2014-03-16 18:41:11 +01:00
local1.tests ash: make "locak VAR" unset VAR (bash does that) 2014-03-16 18:41:11 +01:00
local2.right ash: only allow local variables in functions 2015-10-29 20:33:44 +01:00
local2.tests ash: only allow local variables in functions 2015-10-29 20:33:44 +01:00
nulltick1.right fix bug 1087. Fix by Leonid (lly.dev AT gmail.com) 2010-02-21 01:26:42 +01:00
nulltick1.tests fix bug 1087. Fix by Leonid (lly.dev AT gmail.com) 2010-02-21 01:26:42 +01:00
shift1.right ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1" 2008-07-30 15:35:05 +00:00
shift1.tests ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1" 2008-07-30 15:35:05 +00:00
source1.right ash: fix . builtin 2009-06-14 19:42:12 +02:00
source1.tests ash: fix . builtin 2009-06-14 19:42:12 +02:00
source2.right ash: add two testcases for (not yet fixed) ash bugs 2010-05-17 02:56:18 +02:00
source2.tests ash: fix ". empty_file" exitcode. +5 bytes 2010-05-17 17:10:46 +02:00
source3.right hush: fix ". EMPTY_LINE" not setting $? to 0 2016-09-29 01:27:09 +02:00
source3.tests hush: fix ". EMPTY_LINE" not setting $? to 0 2016-09-29 01:27:09 +02:00
tickquote1.right ash: remove parsebackquote flag 2015-07-13 03:50:27 +02:00
tickquote1.tests ash: remove parsebackquote flag 2015-07-13 03:50:27 +02:00