diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/error.c | 1 | ||||
-rw-r--r-- | src/eval.c | 22 |
2 files changed, 9 insertions, 14 deletions
diff --git a/src/error.c b/src/error.c index 9d31989..f9ea919 100644 --- a/src/error.c +++ b/src/error.c @@ -105,6 +105,7 @@ onint(void) { signal(SIGINT, SIG_DFL); raise(SIGINT); } + exitstatus = SIGINT + 128; exraise(EXINT); /* NOTREACHED */ } diff --git a/src/eval.c b/src/eval.c index 7f06931..0708bf5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -853,21 +853,15 @@ bail: listsetvar(varlist.list, VEXPORT); } if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { - int status; - int i; - - i = exception; - if (i == EXEXIT) - goto raise; - - status = (i == EXINT) ? SIGINT + 128 : 2; - exitstatus = status; - - if (i == EXINT || spclbltin > 0) { -raise: - longjmp(handler->loc, 1); + if (exception == EXERROR) { + exitstatus = 2; + if (spclbltin <= 0) { + FORCEINTON; + break; + } } - FORCEINTON; +raise: + longjmp(handler->loc, 1); } break; |