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();
 }
 
 
60acf755488a7ec936ab959b82dcb219ac67&follow=1'>Recalculate various lengths only as neededJune McEnroe This actually speeds things up quite a bit, saving roughly a second on a big PNG screenshot. Almost all the remaining time is spent in deflate. 2021-09-21Rewrite pngo, add explicit optionsJune McEnroe Interesting to see how my code habits have changed. 2021-09-16Fix /* **/ comment matchingJune McEnroe 2021-09-15Remove typer, add downgrade to READMEJune McEnroe 2021-09-15Set bot mode on downgradeJune McEnroe 2021-09-15Enter capsicum in downgradeJune McEnroe 2021-09-15Factor out common parts of downgrade messagesJune McEnroe Also bump the message cap to 1024 because that is ostensibly useful for replying to older messages. 2021-09-14Add downgrade IRC botJune McEnroe 2021-09-14Sort by title if authors matchJune McEnroe There are probably better things to sort by but title definitely always exists. 2021-09-13Swap-remove tags as they're foundJune McEnroe This makes it even faster. From ~1s on a sqlite3.c amalgamation to ~0.85s. 2021-09-12Replace htagml regex with strncmpJune McEnroe Since ctags only ever produces regular expressions of the form /^re$/ or /^re/ with no other special characters, instead unescape the pattern and simply use strncmp. Running on a sqlite3.c amalgamation, the regex version takes ~37s while the strncmp version takes ~1s, producing identical output. Big win! 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe This fixes badly indented comments. 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe