summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2005-02-25 23:16:05 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:03 +1000
commit155580420a6d49927a95ccae97d880f8cbceda16 (patch)
tree7dccfb482556f09da94a36f74b3fa3cad96db536 /src
parentEliminated global exerrno. (diff)
downloaddash-155580420a6d49927a95ccae97d880f8cbceda16.tar.gz
dash-155580420a6d49927a95ccae97d880f8cbceda16.zip
Optimise away status and case statement in main().
Diffstat (limited to 'src')
-rw-r--r--src/main.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/main.c b/src/main.c
index c686a13..6253010 100644
--- a/src/main.c
+++ b/src/main.c
@@ -123,30 +123,18 @@ main(int argc, char **argv)
 #endif
 	state = 0;
 	if (unlikely(setjmp(jmploc.loc))) {
-		int status;
 		int e;
 		int s;
 
 		reset();
-		s = state;
 
 		e = exception;
-		switch (exception) {
-		case EXERROR:
-			status = 2;
-			break;
-
-		case EXEXIT:
-		case EXEVAL:
-			s = 0;
-			/* fall through */
-		default:
-			status = exitstatus;
-			break;
-		}
-		exitstatus = status;
+		if (e == EXERROR)
+			exitstatus = 2;
 
-		if (s == 0 || iflag == 0 || shlvl)
+		s = state;
+		if (e == EXEXIT || e == EXEVAL ||
+		    s == 0 || iflag == 0 || shlvl)
 			exitshell();
 
 		if (e == EXINT
f='/src/commit/link.sh?id=ccb806d0bd8369100c51d901873d332522087351&follow=1'>Remove tmuxJune McEnroe tmux configuration was starting to bother me, and it got worse with Sierra. Turns out that neovim terminal emulation is much more natural to work with and requires less configuration, though I still disapprove of the feature being included in an editor! For detaching and attaching sessions, abduco is a simple tool that seems to work decently, but given that I will likely only be running neovim in the sessions, I might come up with something even simpler. 2017-07-04Show terminal title in statuslineJune McEnroe 2017-07-04Add nvim terminal mappingsJune McEnroe 2017-06-29Add color to xxJune McEnroe 2017-06-28Set tmux copy-mode-vi bindings for TarmakJune McEnroe 2017-06-27Link Scala syntax fileJune McEnroe Oops. 2017-06-27Clean up top of trivial colorscheme fileJune McEnroe 2017-06-27Fix Scala syntax highlight linksJune McEnroe