summaryrefslogtreecommitdiffstats
path: root/bin/sh/mkbuiltins
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2006-04-02 18:43:33 +0000
committerstefanf <stefanf@FreeBSD.org>2006-04-02 18:43:33 +0000
commit0db401540e16ebc8779d7806d228249018f618ea (patch)
tree2e6fe76395c7ff7cd45cf3c8720c11c04c3b141c /bin/sh/mkbuiltins
parent23153e3ef86a0ab2bdb1079dfeeb9e07459a1021 (diff)
downloadFreeBSD-src-0db401540e16ebc8779d7806d228249018f618ea.zip
FreeBSD-src-0db401540e16ebc8779d7806d228249018f618ea.tar.gz
Use -s to flag POSIX's "special built-in" utilities in builtins.def. Add a
new member to struct builtincmd and set it to 1 if -s was specified. This is done because there are cases where special builtins must be treated differently from other builtins. Obtained from: NetBSD (builtins.def part)
Diffstat (limited to 'bin/sh/mkbuiltins')
-rwxr-xr-xbin/sh/mkbuiltins10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins
index 144505c..7b77649 100755
--- a/bin/sh/mkbuiltins
+++ b/bin/sh/mkbuiltins
@@ -66,9 +66,14 @@ echo '};
const struct builtincmd builtincmd[] = {'
awk '{ for (i = 2 ; i <= NF ; i++) {
- printf "\t{ \"%s\", %d },\n", $i, NR-1
+ if ($i == "-s") {
+ spc = 1;
+ } else {
+ printf "\t{ \"%s\", %d, %d },\n", $i, NR-1, spc
+ spc = 0;
+ }
}}' $temp
-echo ' { NULL, 0 }
+echo ' { NULL, 0, 0 }
};'
exec > ${objdir}/builtins.h
@@ -85,6 +90,7 @@ echo '
struct builtincmd {
char *name;
int code;
+ int special;
};
extern int (*const builtinfunc[])(int, char **);
OpenPOWER on IntegriCloud