ash: <> redir should not truncate
Signed-off-by: Andreas Bühmann <buehmann@users.berlios.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
1b8e2b0e76
commit
da75f44844
@ -4938,7 +4938,7 @@ openredirect(union node *redir)
|
|||||||
break;
|
break;
|
||||||
case NFROMTO:
|
case NFROMTO:
|
||||||
fname = redir->nfile.expfname;
|
fname = redir->nfile.expfname;
|
||||||
f = open(fname, O_RDWR|O_CREAT|O_TRUNC, 0666);
|
f = open(fname, O_RDWR|O_CREAT, 0666);
|
||||||
if (f < 0)
|
if (f < 0)
|
||||||
goto ecreate;
|
goto ecreate;
|
||||||
break;
|
break;
|
||||||
|
2
shell/ash_test/ash-redir/redir9.right
Normal file
2
shell/ash_test/ash-redir/redir9.right
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Ok
|
||||||
|
Done:0
|
4
shell/ash_test/ash-redir/redir9.tests
Normal file
4
shell/ash_test/ash-redir/redir9.tests
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
echo Ok >file.tmp
|
||||||
|
cat 0<>file.tmp
|
||||||
|
echo Done:$?
|
||||||
|
rm file.tmp
|
Loading…
Reference in New Issue
Block a user