Module Name: src
Committed By: apb
Date: Tue Oct 6 19:56:58 UTC 2009
Modified Files:
src/bin/sh: mkbuiltins
Log Message:
Make this slightly more portable; it has to run on arbitary host
platforms at build time. Previousy, some shells were confused by
some of the "[ ... ]" tests.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/mkbuiltins
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/mkbuiltins
diff -u src/bin/sh/mkbuiltins:1.21 src/bin/sh/mkbuiltins:1.22
--- src/bin/sh/mkbuiltins:1.21 Sun Jun 6 07:03:11 2004
+++ src/bin/sh/mkbuiltins Tue Oct 6 19:56:58 2009
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: mkbuiltins,v 1.21 2004/06/06 07:03:11 christos Exp $
+# $NetBSD: mkbuiltins,v 1.22 2009/10/06 19:56:58 apb Exp $
#
# Copyright (c) 1991, 1993
# The Regents of the University of California. All rights reserved.
@@ -34,7 +34,7 @@
# @(#)mkbuiltins 8.2 (Berkeley) 5/4/95
havehist=1
-if [ "X$1" = "X-h" ]; then
+if [ x"$1" = x"-h" ]; then
havehist=0
shift
fi
@@ -89,10 +89,10 @@
echo $line >&4
continue
;;
+ \#*)
+ continue
+ ;;
esac
- l1="${line###}"
- [ "$l1" != "$line" ] && continue
-
func=$1
shift
@@ -106,14 +106,14 @@
}
echo 'int '"$func"'(int, char **);' >&4
while
- [ $# != 0 -a "$1" != '#' ]
+ [ $# != 0 ] && [ x"$1" != x'#' ]
do
- [ "$1" = '-s' ] && {
+ [ x"$1" = x'-s' ] && {
specials="$specials $2 $func"
shift 2
continue;
}
- [ "$1" = '-u' ] && shift
+ [ x"$1" = x'-u' ] && shift
echo ' { "'$1'", '"$func"' },' >&3
shift
done