mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
eeee77ed
implemented a POSIX compliance fix that caused a potential incompatibility with existing ksh scripts; it made the (rarely used) read/write redirection operator, <>, default to file descriptor 0 (standard input) as POSIX specified, instead of 1 (standard output) which is traditional ksh93 behaviour. So ksh scripts needed to change all <> to 1<> to override the new default. This commit reverts that change, except in the new posix mode. src/cmd/ksh93/sh/lex.c: - Make FD for <> default to 0 in POSIX mode, 1 otherwise. src/cmd/ksh93/tests/io.sh: - Revert <> regression test changes from60516872
; we no longer need 1<> instead of <> in ksh code.
This commit is contained in:
parent
fd977388a2
commit
c607c48c84
4 changed files with 10 additions and 5 deletions
|
@ -304,14 +304,14 @@ fi
|
|||
$SHELL -c 'exec 3<>; /dev/null' 2> /dev/null && err_exit '<>; with exec should be an error'
|
||||
$SHELL -c ': 3<>; /dev/null' 2> /dev/null || err_exit '<>; not working with at all'
|
||||
print $'hello\nworld' > $tmp/1
|
||||
if ! $SHELL -c "false 1<>; $tmp/1" 2> /dev/null
|
||||
if ! $SHELL -c "false <>; $tmp/1" 2> /dev/null
|
||||
then [[ $(<$tmp/1) == $'hello\nworld' ]] || err_exit '<>; not preserving file on failure'
|
||||
fi
|
||||
if ! $SHELL -c "head -1 $tmp/1" 1<>; $tmp/1 2> /dev/null
|
||||
if ! $SHELL -c "head -1 $tmp/1" <>; $tmp/1 2> /dev/null
|
||||
then [[ $(<$tmp/1) == hello ]] || err_exit '<>; not truncating file on success of head'
|
||||
fi
|
||||
print $'hello\nworld' > $tmp/1
|
||||
if ! $SHELL -c head < $tmp/1 <#((6)) 1<>; $tmp/1 2> /dev/null
|
||||
if ! $SHELL -c head < $tmp/1 <#((6)) <>; $tmp/1 2> /dev/null
|
||||
then [[ $(<$tmp/1) == world ]] || err_exit '<>; not truncating file on success of behead'
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue