diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-01 15:27:44 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-01 15:27:44 +0200 |
commit | 0840c91909dd6a9a676ec105ef1ca5e8d36ce6e8 (patch) | |
tree | ded6730af2aab42ab591dddaea83c669bd3cb3dc | |
parent | 7b3fa1e441bbb34a9edccf17b71efc34499bde9f (diff) | |
download | busybox-w32-0840c91909dd6a9a676ec105ef1ca5e8d36ce6e8.tar.gz busybox-w32-0840c91909dd6a9a676ec105ef1ca5e8d36ce6e8.tar.bz2 busybox-w32-0840c91909dd6a9a676ec105ef1ca5e8d36ce6e8.zip |
ash: [EVAL] Revert SKIPEVAL into EXEXIT
Upstream commit:
Date: Tue Aug 11 20:56:53 2009 +1000
[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>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/shell/ash.c b/shell/ash.c index d107fa1fd..644ef6c9d 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8407,7 +8407,6 @@ defun(char *name, union node *func) | |||
8407 | #define SKIPBREAK (1 << 0) | 8407 | #define SKIPBREAK (1 << 0) |
8408 | #define SKIPCONT (1 << 1) | 8408 | #define SKIPCONT (1 << 1) |
8409 | #define SKIPFUNC (1 << 2) | 8409 | #define SKIPFUNC (1 << 2) |
8410 | #define SKIPEVAL (1 << 4) | ||
8411 | static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ | 8410 | static smallint evalskip; /* set to SKIPxxx if we are skipping commands */ |
8412 | static int skipcount; /* number of levels to skip */ | 8411 | static int skipcount; /* number of levels to skip */ |
8413 | static int funcnest; /* depth of function calls */ | 8412 | static int funcnest; /* depth of function calls */ |
@@ -8612,13 +8611,10 @@ evaltree(union node *n, int flags) | |||
8612 | /* Order of checks below is important: | 8611 | /* Order of checks below is important: |
8613 | * signal handlers trigger before exit caused by "set -e". | 8612 | * signal handlers trigger before exit caused by "set -e". |
8614 | */ | 8613 | */ |
8615 | if (pending_sig && dotrap()) | 8614 | if ((pending_sig && dotrap()) |
8616 | goto exexit; | 8615 | || (checkexit & status) |
8617 | if (checkexit & status) | 8616 | || (flags & EV_EXIT) |
8618 | evalskip |= SKIPEVAL; | 8617 | ) { |
8619 | |||
8620 | if (flags & EV_EXIT) { | ||
8621 | exexit: | ||
8622 | raise_exception(EXEXIT); | 8618 | raise_exception(EXEXIT); |
8623 | } | 8619 | } |
8624 | 8620 | ||
@@ -12360,7 +12356,7 @@ cmdloop(int top) | |||
12360 | 12356 | ||
12361 | if (skip) { | 12357 | if (skip) { |
12362 | evalskip &= ~SKIPFUNC; | 12358 | evalskip &= ~SKIPFUNC; |
12363 | return skip & SKIPEVAL; | 12359 | break; |
12364 | } | 12360 | } |
12365 | } | 12361 | } |
12366 | return status; | 12362 | return status; |
@@ -13263,14 +13259,10 @@ procargs(char **argv) | |||
13263 | static void | 13259 | static void |
13264 | read_profile(const char *name) | 13260 | read_profile(const char *name) |
13265 | { | 13261 | { |
13266 | int skip; | ||
13267 | |||
13268 | if (setinputfile(name, INPUT_PUSH_FILE | INPUT_NOFILE_OK) < 0) | 13262 | if (setinputfile(name, INPUT_PUSH_FILE | INPUT_NOFILE_OK) < 0) |
13269 | return; | 13263 | return; |
13270 | skip = cmdloop(0); | 13264 | cmdloop(0); |
13271 | popfile(); | 13265 | popfile(); |
13272 | if (skip) | ||
13273 | exitshell(); | ||
13274 | } | 13266 | } |
13275 | 13267 | ||
13276 | /* | 13268 | /* |