From 02329a97bcbda718523302f940fd4c8dcee3c239 Mon Sep 17 00:00:00 2001 From: sg Date: Thu, 11 Nov 1999 19:43:49 +0000 Subject: [PATCH] * fixed severe bug: change by ? in dup2 (flushing) resulted in broken AssignStream functions --- rtl/linux/linux.pp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rtl/linux/linux.pp b/rtl/linux/linux.pp index 9a1ca091f3..3748965dc7 100644 --- a/rtl/linux/linux.pp +++ b/rtl/linux/linux.pp @@ -1920,8 +1920,10 @@ Function Dup2(var oldfile,newfile:text):Boolean; var tmphandle : word; begin - flush(oldfile);{ We cannot share buffers, so we flush them. } - flush(newfile); + if TextRec(oldfile).mode in [fmOutput, fmInOut, fmAppend] then + flush(oldfile);{ We cannot share buffers, so we flush them. } + if TextRec(newfile).mode in [fmOutput, fmInOut, fmAppend] then + flush(newfile); tmphandle:=textrec(newfile).handle; textrec(newfile):=textrec(oldfile); textrec(newfile).handle:=tmphandle; @@ -3790,7 +3792,11 @@ End. { $Log$ - Revision 1.50 1999-11-06 14:39:12 peter + Revision 1.51 1999-11-11 19:43:49 sg + * fixed severe bug: change by ? in dup2 (flushing) resulted in broken + AssignStream functions + + Revision 1.50 1999/11/06 14:39:12 peter * truncated log Revision 1.49 1999/10/28 09:48:31 peter