From 68097929869a3a3e511ac2e2c3d9dc3730652286 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 11 Aug 2009 20:48:15 +1000 Subject: [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 --- src/builtins.def.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/builtins.def.in') 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 -- cgit 1.4.1