mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix ksh93/features/options tests
src/cmd/ksh93/features/options: - Fix unportable SHELLMAGIC test: 1. /bin/echo does not work on all systems, but /usr/bin/env is a de-facto standard path (even NixOS gave in and has it). 2. Do not try to execute a temp file in /tmp as it might be mounted noexec. Use our own $EXECROOT instead. - rm unnecessary 'exec 9<&-' (it was never opened globally). - Remove broken SHOPT_UCB test. It had a syntax error, but the result is not used anywhere.
This commit is contained in:
parent
efcc66a3f5
commit
4ae962aba6
1 changed files with 5 additions and 8 deletions
13
src/cmd/ksh93/features/options
Executable file → Normal file
13
src/cmd/ksh93/features/options
Executable file → Normal file
|
@ -2,15 +2,15 @@
|
||||||
|
|
||||||
tst cross{
|
tst cross{
|
||||||
: check for shell magic #!
|
: check for shell magic #!
|
||||||
cat > /tmp/file$$ <<!
|
cat > "$EXECROOT/file$$" <<!
|
||||||
#! /bin/echo
|
#! /usr/bin/env true
|
||||||
exit 1
|
exit 1
|
||||||
!
|
!
|
||||||
chmod 755 /tmp/file$$
|
chmod 755 "$EXECROOT/file$$"
|
||||||
if /tmp/file$$ > /dev/null
|
if "$EXECROOT/file$$" 2>/dev/null
|
||||||
then echo "#define SHELLMAGIC 1"
|
then echo "#define SHELLMAGIC 1"
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/file$$
|
rm -f "$EXECROOT/file$$"
|
||||||
|
|
||||||
option() # name value
|
option() # name value
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,6 @@ tst cross{
|
||||||
|
|
||||||
ls /dev/fd/9 9<&0 >/dev/null 2>&1
|
ls /dev/fd/9 9<&0 >/dev/null 2>&1
|
||||||
option DEVFD $?
|
option DEVFD $?
|
||||||
exec 9<&-
|
|
||||||
case `echo a | tr a '\012' | wc -l` in
|
case `echo a | tr a '\012' | wc -l` in
|
||||||
*1*) option MULTIBYTE 0 ;;
|
*1*) option MULTIBYTE 0 ;;
|
||||||
esac
|
esac
|
||||||
|
@ -36,8 +35,6 @@ tst cross{
|
||||||
option TEST_L $?
|
option TEST_L $?
|
||||||
test -f /etc/ksh.kshrc -o -f /etc/bash.bashrc &&
|
test -f /etc/ksh.kshrc -o -f /etc/bash.bashrc &&
|
||||||
option SYSRC 0
|
option SYSRC 0
|
||||||
test -f /bin/universe && univ=`/bin/universe` > /dev/null 2>&1 -a ucb = "$univ"
|
|
||||||
option UCB $?
|
|
||||||
}end
|
}end
|
||||||
|
|
||||||
cat{
|
cat{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue