Skip to content

Commit

Permalink
sh: Remove remnants to compile out fc completely
Browse files Browse the repository at this point in the history
r360139 made compiling with NO_HISTORY work. This #define does not remove
the fc and bind builtins completely but makes them always write an error
message.

However, there was also some code in builtins.def and mkbuiltins to remove
the fc builtin entirely (but not the bind builtin). The additional build
system complication to make this work seems not worth it, so remove that
code.
  • Loading branch information
jillest committed Apr 22, 2020
1 parent 8262311 commit da06ef2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions bin/sh/builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
# of a C routine.
# The -j flag specifies that this command is to be excluded from systems
# without job control.
# The -h flag specifies that this command is to be excluded from systems
# based on the NO_HISTORY compile-time symbol.
# The -n flag specifies that this command can safely be run in the same
# process when it is the only command in a command substitution. Some
# commands have special logic defined in safe_builtin().
Expand Down Expand Up @@ -71,7 +69,7 @@ fgcmd -j fg
freebsd_wordexpcmd freebsd_wordexp
getoptscmd getopts
hashcmd hash
histcmd -h fc
histcmd fc
jobidcmd -n jobid
jobscmd -n jobs
killcmd -n kill
Expand Down
9 changes: 2 additions & 7 deletions bin/sh/mkbuiltins
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
# $FreeBSD$

temp=`mktemp -t ka`
havehist=1
if [ "X$1" = "X-h" ]; then
havehist=0
shift
fi
srcdir=$1
havejobs=0
if grep '^#define[ ]*JOBS[ ]*1' $srcdir/shell.h > /dev/null
Expand All @@ -56,8 +51,8 @@ cat <<\!
#include "builtins.h"
!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp
awk '/^[^#]/ {if('$havejobs' || $2 != "-j") \
print $0}' $srcdir/builtins.def | sed 's/-j//' > $temp
echo 'int (*const builtinfunc[])(int, char **) = {'
awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp
echo '};
Expand Down

0 comments on commit da06ef2

Please sign in to comment.