From 155580420a6d49927a95ccae97d880f8cbceda16 Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 25 Feb 2005 23:16:05 +1100 Subject: Optimise away status and case statement in main(). --- src/main.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src') 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 -- cgit 1.4.1