All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [EVAL] with set -e exit the shell if a subshell exits non-zero
@ 2010-06-14  9:56 Gerrit Pape
  2010-06-28  7:02 ` Herbert Xu
  2010-07-06  9:51 ` Herbert Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Gerrit Pape @ 2010-06-14  9:56 UTC (permalink / raw)
  To: dash; +Cc: Herbert Xu

Example:

$ dash -c 'set -e; (false); echo here'
here

With this commit, dash exits 1 before echo.

The bug was reported by Stefan Fritsch through
 http://bugs.debian.org/514863

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 src/eval.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index 439f881..a0d0f3b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -251,6 +251,8 @@ checkexit:
 	case NSUBSHELL:
 	case NBACKGND:
 		evalfn = evalsubshell;
+		if (eflag && !(flags & EV_TESTED))
+			checkexit = ~0;
 		goto calleval;
 	case NPIPE:
 		evalfn = evalpipe;
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-06  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14  9:56 [PATCH] [EVAL] with set -e exit the shell if a subshell exits non-zero Gerrit Pape
2010-06-28  7:02 ` Herbert Xu
2010-06-28  7:22   ` Cristian Ionescu-Idbohrn
2010-06-28 13:16     ` Eric Blake
2010-07-05  8:26       ` Herbert Xu
2010-07-06  9:51 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.