From da75f4484469ca0122b80de69bf3b75a6be71efc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20B=C3=BChmann?= Date: Thu, 24 Jun 2010 04:32:37 +0200 Subject: [PATCH] ash: <> redir should not truncate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Bühmann Signed-off-by: Denys Vlasenko --- shell/ash.c | 2 +- shell/ash_test/ash-redir/redir9.right | 2 ++ shell/ash_test/ash-redir/redir9.tests | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 shell/ash_test/ash-redir/redir9.right create mode 100644 shell/ash_test/ash-redir/redir9.tests diff --git a/shell/ash.c b/shell/ash.c index f581b5bdf..1f8f90a09 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4938,7 +4938,7 @@ openredirect(union node *redir) break; case NFROMTO: 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) goto ecreate; break; diff --git a/shell/ash_test/ash-redir/redir9.right b/shell/ash_test/ash-redir/redir9.right new file mode 100644 index 000000000..34c2512e4 --- /dev/null +++ b/shell/ash_test/ash-redir/redir9.right @@ -0,0 +1,2 @@ +Ok +Done:0 diff --git a/shell/ash_test/ash-redir/redir9.tests b/shell/ash_test/ash-redir/redir9.tests new file mode 100644 index 000000000..8befa611c --- /dev/null +++ b/shell/ash_test/ash-redir/redir9.tests @@ -0,0 +1,4 @@ +echo Ok >file.tmp +cat 0<>file.tmp +echo Done:$? +rm file.tmp -- 2.25.1