summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-10-06 21:22:43 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-10-06 21:22:43 +0800
commitf14b4626eb5c1c2fda137e7d1520c5f1cb7e85c4 (patch)
tree490ba8c3ec141fd43fd47419d7b33ace7361b6ec /ChangeLog
parent[EVAL] Move common skipcount logic into skiploop (diff)
downloaddash-f14b4626eb5c1c2fda137e7d1520c5f1cb7e85c4.tar.gz
dash-f14b4626eb5c1c2fda137e7d1520c5f1cb7e85c4.zip
[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>
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog1
1 files changed, 1 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d88e13..297b81a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
 	* Exit without arguments in a trap should use status outside traps.
 	* Do not allow break to break across function calls.
 	* Move common skipcount logic into skiploop.
+	* Allow return in loop conditional to set exit status.
 
 2014-10-03  Herbert Xu <herbert@gondor.apana.org.au>