diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-08-11 20:48:15 +1000 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-08-11 20:48:15 +1000 |
commit | 68097929869a3a3e511ac2e2c3d9dc3730652286 (patch) | |
tree | 5beaae81eaabcf9d80f88a8744945fd4d9caac5c /src/builtins.def.in | |
parent | [SHELL] Add preliminary LINENO support (diff) | |
download | dash-68097929869a3a3e511ac2e2c3d9dc3730652286.tar.gz dash-68097929869a3a3e511ac2e2c3d9dc3730652286.zip |
[EVAL] Pass EV_TESTED into evalcmd
This patch fixes the case where the eval command is used with set -e and as part of a construct that should not cause the shell to abort, e.g., as part of the condition of an if statement. This is achieved by propagating the EV_TESTED flag into the evalstring function through evalcmd. As this alters the prototype of evalcmd it is now invoked explicitly by evalbltin. The built-in infrastructure has been changed to accomodate this special case. In order to ensure that the EXIT trap is properly executed this patch clears evalskip in exitshell. This wasn't needed before because of the broken way evalstring worked where it always clears evalskip when called by minusc. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | src/builtins.def.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/builtins.def.in b/src/builtins.def.in index 362ff3f..266d0ec 100644 --- a/src/builtins.def.in +++ b/src/builtins.def.in @@ -40,6 +40,7 @@ * The -a flag specifies that this is a posix 'assignment builtin' command. * The -s flag specifies that this is a posix 'special builtin' command. * The -u flag specifies that this is a posix 'standard utility'. + * The -n flag specifies that this command has a special entry point. * The rest of the line specifies the command name or names used to run * the command. */ @@ -62,7 +63,7 @@ cdcmd -u cd chdir commandcmd -u command dotcmd -s . echocmd echo -evalcmd -s eval +evalcmd -ns eval execcmd -s exec exitcmd -s exit exportcmd -as export -as readonly |