From be158cec7a4ff44c781eca49d17108815ca977ec Mon Sep 17 00:00:00 2001
From: florian <florian@freepascal.org>
Date: Tue, 20 Feb 2018 21:30:30 +0000
Subject: [PATCH] * reset I/O result before and after the implicit close calls
 in ISO pascal mode,   this avoids further I/O operations to be carried out,
 resolves issue #32743

git-svn-id: trunk@38301 -
---
 rtl/inc/text.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rtl/inc/text.inc b/rtl/inc/text.inc
index e0c205a030..407ffe1639 100644
--- a/rtl/inc/text.inc
+++ b/rtl/inc/text.inc
@@ -672,7 +672,11 @@ end;
 
 Procedure fpc_textclose_iso(var t : Text);compilerproc;
 begin
+  { reset inout result as this procedure is only called by the compiler and no I/O checking is carried out,
+    so further I/O does not fail }
+  inoutres:=0;
   close(t);
+  inoutres:=0;
 end;