From 6fb17897d620572290b1f604430c06c261145aad Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 28 May 2015 12:52:36 +0100 Subject: ash: seek to EOF when file is opened for append This shouldn't be necessary but without it the offset becomes zero when an external command is run. rm -f log echo 1234567890 >>log cmd /c echo hi >>log echo 1234567890 >>log Before this change log would contain: hi 567890 1234567890 --- shell/ash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/ash.c b/shell/ash.c index 578904478..34d5af446 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -5455,6 +5455,9 @@ openredirect(union node *redir) f = open(fname, O_WRONLY|O_CREAT|O_APPEND, 0666); if (f < 0) goto ecreate; +#if ENABLE_PLATFORM_MINGW32 + lseek(f, 0, SEEK_END); +#endif break; default: #if DEBUG -- cgit v1.2.3-55-g6feb