1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix BUG_REDIRIO

ksh used to redirect standard output by default when no file
descriptor was specified with the rarely used '<>' reading/writing
redirection operator. It now redirects standard input by default,
as POSIX specifies and as all other POSIX shells do. To redirect
standard output for reading and writing, you now need '1<>'.

Ref.: https://github.com/att/ast/issues/75
      http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07

(cherry picked from commit 29afc16c47824fc79ed092ae7704c525b1db6a0a)
This commit is contained in:
Martijn Dekker 2020-05-13 15:00:33 +01:00
parent 915b2b2e19
commit eeee77edd1
4 changed files with 11 additions and 8 deletions

View file

@ -599,7 +599,7 @@ int sh_lex(Lex_t* lp)
c |= SYMPIPE;
else if(c=='<' && n=='>')
{
lp->digits = 1;
lp->digits = 0;
c = IORDWRSYM;
fcgetc(n);
if(fcgetc(n)==';')