fix on Interix, where tr(1) is more weird than even Solaris’ XPG4 one…
just do not use ranges, no matter what.
This commit is contained in:
parent
c7594709db
commit
8d170a3d01
14
Build.sh
14
Build.sh
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $MirOS: src/bin/mksh/Build.sh,v 1.277 2008/02/29 11:57:30 tg Exp $
|
# $MirOS: src/bin/mksh/Build.sh,v 1.278 2008/02/29 16:38:40 tg Exp $
|
||||||
#-
|
#-
|
||||||
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
|
# Environment used: CC CFLAGS CPPFLAGS LDFLAGS LIBS NOWARN NROFF TARGET_OS
|
||||||
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
|
# CPPFLAGS recognised: MKSH_SMALL MKSH_ASSUME_UTF8 MKSH_NOPWNAM MKSH_NOVI
|
||||||
|
@ -18,8 +18,6 @@ if test -d /usr/xpg4/bin/. >/dev/null 2>&1; then
|
||||||
PATH=/usr/xpg4/bin:$PATH
|
PATH=/usr/xpg4/bin:$PATH
|
||||||
export PATH
|
export PATH
|
||||||
fi
|
fi
|
||||||
tr=/usr/ucb/tr # Solaris: /usr/xpg4/bin/tr fails the rot13 tr command
|
|
||||||
test -f $tr || tr=tr
|
|
||||||
|
|
||||||
if test -n "${ZSH_VERSION+x}" && (emulate sh) >/dev/null 2>&1; then
|
if test -n "${ZSH_VERSION+x}" && (emulate sh) >/dev/null 2>&1; then
|
||||||
emulate sh
|
emulate sh
|
||||||
|
@ -47,7 +45,7 @@ if test -t 1; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
upper() {
|
upper() {
|
||||||
echo :"$@" | sed 's/^://' | $tr $alll $allu
|
echo :"$@" | sed 's/^://' | tr $alll $allu
|
||||||
}
|
}
|
||||||
|
|
||||||
# clean up after ac_testrun()
|
# clean up after ac_testrun()
|
||||||
|
@ -176,7 +174,7 @@ ac_header() {
|
||||||
na=0
|
na=0
|
||||||
fi
|
fi
|
||||||
hf=$1; shift
|
hf=$1; shift
|
||||||
hv=`echo "$hf" | $tr -d '\012\015' | $tr -c $alll$allu$alln $alls`
|
hv=`echo "$hf" | tr -d '\012\015' | tr -c $alll$allu$alln $alls`
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
echo "#include <$i>" >>x
|
echo "#include <$i>" >>x
|
||||||
|
@ -384,7 +382,7 @@ cat >scn.c <<-'EOF'
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
ct=unknown
|
ct=unknown
|
||||||
eval 'v "$CPP scn.c | grep ct= | $tr -d \\\\015 >x" 2>&'$h | sed 's/^/] /'
|
eval 'v "$CPP scn.c | grep ct= | tr -d \\\\015 >x" 2>&'$h | sed 's/^/] /'
|
||||||
test 1 = $h && sed 's/^/[ /' x
|
test 1 = $h && sed 's/^/[ /' x
|
||||||
eval `cat x`
|
eval `cat x`
|
||||||
rm -f x
|
rm -f x
|
||||||
|
@ -485,7 +483,7 @@ NOWARN=$save_NOWARN
|
||||||
#
|
#
|
||||||
# Compiler: extra flags (-O2 -f* -W* etc.)
|
# Compiler: extra flags (-O2 -f* -W* etc.)
|
||||||
#
|
#
|
||||||
i=`echo :"$orig_CFLAGS" | sed 's/^://' | $tr -c -d $alll$allu$alln`
|
i=`echo :"$orig_CFLAGS" | sed 's/^://' | tr -c -d $alll$allu$alln`
|
||||||
# optimisation: only if orig_CFLAGS is empty
|
# optimisation: only if orig_CFLAGS is empty
|
||||||
test x"$i" = x"" && if test $ct = sunpro; then
|
test x"$i" = x"" && if test $ct = sunpro; then
|
||||||
cat >x <<-'EOF'
|
cat >x <<-'EOF'
|
||||||
|
@ -994,7 +992,7 @@ case $curdir in
|
||||||
*) echo "#!$curdir/mksh" >test.sh ;;
|
*) echo "#!$curdir/mksh" >test.sh ;;
|
||||||
esac
|
esac
|
||||||
echo "export PATH='$PATH'" >>test.sh
|
echo "export PATH='$PATH'" >>test.sh
|
||||||
echo "exec perl '$srcdir/check.pl' -s '$srcdir/check.t' -e 'tr=$tr'" \
|
echo "exec perl '$srcdir/check.pl' -s '$srcdir/check.t'" \
|
||||||
"-p '$curdir/mksh' -C $check_categories \$*$tsts" >>test.sh
|
"-p '$curdir/mksh' -C $check_categories \$*$tsts" >>test.sh
|
||||||
chmod 755 test.sh
|
chmod 755 test.sh
|
||||||
echo set -x >Rebuild.sh
|
echo set -x >Rebuild.sh
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -1,4 +1,4 @@
|
||||||
# $MirOS: src/bin/mksh/Makefile,v 1.51 2008/02/29 11:57:30 tg Exp $
|
# $MirOS: src/bin/mksh/Makefile,v 1.52 2008/02/29 16:38:40 tg Exp $
|
||||||
#-
|
#-
|
||||||
# use CPPFLAGS=-DDEBUG __CRAZY=Yes to check for certain more stuff
|
# use CPPFLAGS=-DDEBUG __CRAZY=Yes to check for certain more stuff
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ regress: ${PROG} check.pl check.t
|
||||||
mkdir -p regress-dir
|
mkdir -p regress-dir
|
||||||
echo export FNORD=666 >regress-dir/.mkshrc
|
echo export FNORD=666 >regress-dir/.mkshrc
|
||||||
HOME=$$(readlink -nf regress-dir) perl ${.CURDIR}/check.pl \
|
HOME=$$(readlink -nf regress-dir) perl ${.CURDIR}/check.pl \
|
||||||
-e tr=tr -s ${.CURDIR}/check.t -v -p ./${PROG} -C pdksh
|
-s ${.CURDIR}/check.t -v -p ./${PROG} -C pdksh
|
||||||
|
|
||||||
test-build: .PHONY
|
test-build: .PHONY
|
||||||
-rm -rf build-dir
|
-rm -rf build-dir
|
||||||
|
|
18
check.t
18
check.t
|
@ -1,4 +1,4 @@
|
||||||
# $MirOS: src/bin/mksh/check.t,v 1.150 2008/02/29 11:48:32 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.151 2008/02/29 16:38:40 tg Exp $
|
||||||
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||||
|
@ -1292,12 +1292,12 @@ description:
|
||||||
stdin:
|
stdin:
|
||||||
bar="bar
|
bar="bar
|
||||||
baz"
|
baz"
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<foo
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<foo
|
||||||
$0 -c "$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<foo"
|
$0 -c "tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<foo"
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<"$bar"
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<"$bar"
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<'$bar'
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<'$bar'
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<\$bar
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<\$bar
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<-foo
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<-foo
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
sbb
|
sbb
|
||||||
sbb
|
sbb
|
||||||
|
@ -1314,7 +1314,7 @@ stdin:
|
||||||
fnord=42
|
fnord=42
|
||||||
bar="bar
|
bar="bar
|
||||||
\$fnord baz"
|
\$fnord baz"
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<$bar
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<$bar
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
one $sabeq onm
|
one $sabeq onm
|
||||||
category: bash
|
category: bash
|
||||||
|
@ -1326,7 +1326,7 @@ stdin:
|
||||||
fnord=42
|
fnord=42
|
||||||
bar="bar
|
bar="bar
|
||||||
\$fnord baz"
|
\$fnord baz"
|
||||||
$tr '[A-Za-z]' '[N-ZA-Mn-za-m]' <<<$bar
|
tr abcdefghijklmnopqrstuvwxyz nopqrstuvwxyzabcdefghijklm <<<$bar
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
one
|
one
|
||||||
$sabeq onm
|
$sabeq onm
|
||||||
|
|
10
dot.mkshrc
10
dot.mkshrc
|
@ -1,4 +1,4 @@
|
||||||
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.25 2008/02/29 11:48:32 tg Exp $
|
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.26 2008/02/29 16:38:41 tg Stab $
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2007
|
# Copyright (c) 2007
|
||||||
# Thorsten Glaser <tg@mirbsd.de>
|
# Thorsten Glaser <tg@mirbsd.de>
|
||||||
|
@ -52,11 +52,9 @@ alias la='l -a'
|
||||||
alias ll='l -l'
|
alias ll='l -l'
|
||||||
alias lo='la -lo'
|
alias lo='la -lo'
|
||||||
alias which='whence -p'
|
alias which='whence -p'
|
||||||
whence -p rot13 >&- || if [[ -x /usr/ucb/tr ]]; then
|
whence -p rot13 >&- || alias rot13='tr \
|
||||||
alias rot13="/usr/ucb/tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
|
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
|
||||||
else
|
nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
|
||||||
alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
|
|
||||||
fi
|
|
||||||
whence -p hd >&- || function hd {
|
whence -p hd >&- || function hd {
|
||||||
hexdump -e '"%08.8_ax " 8/1 "%02X " " - " 8/1 "%02X "' \
|
hexdump -e '"%08.8_ax " 8/1 "%02X " " - " 8/1 "%02X "' \
|
||||||
-e '" |" "%_p"' -e '"|\n"' "$@"
|
-e '" |" "%_p"' -e '"|\n"' "$@"
|
||||||
|
|
Loading…
Reference in New Issue