1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +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:
Martijn Dekker 2020-10-06 10:00:52 +02:00
parent efcc66a3f5
commit 4ae962aba6

13
src/cmd/ksh93/features/options Executable file → Normal file
View file

@ -2,15 +2,15 @@
tst cross{
: check for shell magic #!
cat > /tmp/file$$ <<!
#! /bin/echo
cat > "$EXECROOT/file$$" <<!
#! /usr/bin/env true
exit 1
!
chmod 755 /tmp/file$$
if /tmp/file$$ > /dev/null
chmod 755 "$EXECROOT/file$$"
if "$EXECROOT/file$$" 2>/dev/null
then echo "#define SHELLMAGIC 1"
fi
rm -f /tmp/file$$
rm -f "$EXECROOT/file$$"
option() # name value
{
@ -26,7 +26,6 @@ tst cross{
ls /dev/fd/9 9<&0 >/dev/null 2>&1
option DEVFD $?
exec 9<&-
case `echo a | tr a '\012' | wc -l` in
*1*) option MULTIBYTE 0 ;;
esac
@ -36,8 +35,6 @@ tst cross{
option TEST_L $?
test -f /etc/ksh.kshrc -o -f /etc/bash.bashrc &&
option SYSRC 0
test -f /bin/universe && univ=`/bin/universe` > /dev/null 2>&1 -a ucb = "$univ"
option UCB $?
}end
cat{