summary refs log tree commit diff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-08-11 20:56:53 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2009-08-11 20:56:53 +1000
commitd53f173bb00bcc1d89ceb9e82b7d7e2b2a8dd852 (patch)
tree7054b149105e685666c0a57d1e53e3d03a1709f2
parent[EVAL] Pass EV_TESTED into evalcmd (diff)
downloaddash-d53f173bb00bcc1d89ceb9e82b7d7e2b2a8dd852.tar.gz
dash-d53f173bb00bcc1d89ceb9e82b7d7e2b2a8dd852.zip
[EVAL] Revert SKIPEVAL into EXEXIT
Now that eval handles EV_TESTED correctly, we can remove the
SKIPEVAL hack and simply use EXEXIT for set -e.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--ChangeLog1
-rw-r--r--src/eval.c11
-rw-r--r--src/eval.h1
-rw-r--r--src/main.c9
4 files changed, 6 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index beaad36..9d397e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-08-11  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Pass EV_TESTED into evalcmd.
+	* Revert SKIPEVAL into EXEXIT.
 
 2009-08-11  Rocky Bernstein <rocky.bernstein@gmail.com>
 
diff --git a/src/eval.c b/src/eval.c
index 66c2209..2f195af 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -309,15 +309,10 @@ setstatus:
 		break;
 	}
 out:
-	if ((checkexit & exitstatus))
-		evalskip |= SKIPEVAL;
-	else if (pendingsigs && dotrap())
-		goto exexit;
-
-	if (flags & EV_EXIT) {
-exexit:
+	if ((checkexit & exitstatus) ||
+	    (pendingsigs && dotrap()) ||
+	    (flags & EV_EXIT))
 		exraise(EXEXIT);
-	}
 }
 
 
diff --git a/src/eval.h b/src/eval.h
index 005620d..e190b28 100644
--- a/src/eval.h
+++ b/src/eval.h
@@ -59,4 +59,3 @@ extern int evalskip;
 #define SKIPCONT	(1 << 1)
 #define SKIPFUNC	(1 << 2)
 #define SKIPFILE	(1 << 3)
-#define SKIPEVAL	(1 << 4)
diff --git a/src/main.c b/src/main.c
index 7d07e2d..2bff956 100644
--- a/src/main.c
+++ b/src/main.c
@@ -243,7 +243,7 @@ cmdloop(int top)
 		skip = evalskip;
 		if (skip) {
 			evalskip = 0;
-			return skip & SKIPEVAL;
+			break;
 		}
 	}
 
@@ -259,17 +259,12 @@ cmdloop(int top)
 STATIC void
 read_profile(const char *name)
 {
-	int skip;
-
 	name = expandstr(name);
 	if (setinputfile(name, INPUT_PUSH_FILE | INPUT_NOFILE_OK) < 0)
 		return;
 
-	skip = cmdloop(0);
+	cmdloop(0);
 	popfile();
-
-	if (skip)
-		exitshell();
 }