35ec818fa2
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> |
||
---|---|---|
.. | ||
command2.right | ||
command2.tests | ||
command.right | ||
command.tests | ||
echo_write_error.right | ||
echo_write_error.tests | ||
errexit1.right | ||
errexit1.tests | ||
eval1.right | ||
eval1.tests | ||
eval2.right | ||
eval2.tests | ||
exec.right | ||
exec.tests | ||
exitcode1.right | ||
exitcode1.tests | ||
for.right | ||
for.tests | ||
func1.right | ||
func1.tests | ||
func2.right | ||
func2.tests | ||
func3.right | ||
func3.tests | ||
func4.right | ||
func4.tests | ||
func5.right | ||
func5.tests | ||
func6.right | ||
func6.tests | ||
func_args1.right | ||
func_args1.tests | ||
func_bash1.right | ||
func_bash1.tests | ||
func_local1.right | ||
func_local1.tests | ||
func_local2.right | ||
func_local2.tests | ||
last_amp.right | ||
last_amp.tests | ||
local1.right | ||
local1.tests | ||
local2.right | ||
local2.tests | ||
nulltick1.right | ||
nulltick1.tests | ||
shift1.right | ||
shift1.tests | ||
source1.right | ||
source1.tests | ||
source2.right | ||
source2.tests | ||
source3.right | ||
source3.tests | ||
tickquote1.right | ||
tickquote1.tests |