busybox/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
last_amp.tests
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
nulltick1.tests
shift1.right
shift1.tests
source1.right
source1.tests
source2.right
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