summary refs log tree commit diff
path: root/src/mkbuiltins
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-08-11 20:48:15 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2009-08-11 20:48:15 +1000
commit68097929869a3a3e511ac2e2c3d9dc3730652286 (patch)
tree5beaae81eaabcf9d80f88a8744945fd4d9caac5c /src/mkbuiltins
parent[SHELL] Add preliminary LINENO support (diff)
downloaddash-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 'src/mkbuiltins')
-rw-r--r--src/mkbuiltins3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mkbuiltins b/src/mkbuiltins
index 424d59a..977edb4 100644
--- a/src/mkbuiltins
+++ b/src/mkbuiltins
@@ -71,7 +71,8 @@ awk '{	for (i = 2 ; i <= NF ; i++) {
 			opt = substr($2, 2)
 			$2 = $3
 		}
-		printf "\t{ \"%s\", %s, %d },\n", $1, $2,
+		printf "\t{ \"%s\", %s, %d },\n", $1,
+			(opt ~ /n/) ? "NULL" : $2,
 			(opt ~ /s/) + (opt ~ /[su]/) * 2 + (opt ~ /a/) * 4
 	}'
 echo '};'