From 7032c8004112e0a180a843fc5fe9aee6cc29baaa Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 28 Dec 2019 10:35:46 +0000 Subject: [PATCH] * accept #26 as eof in iso mode, resolves #35136 git-svn-id: trunk@43801 - --- .gitattributes | 1 + rtl/inc/iso7185.pp | 2 +- tests/webtbs/tw35136.pp | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw35136.pp diff --git a/.gitattributes b/.gitattributes index 583d912e74..6c9fec30e3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17838,6 +17838,7 @@ tests/webtbs/tw35027.pp svneol=native#text/pascal tests/webtbs/tw35028.pp svneol=native#text/pascal tests/webtbs/tw3504.pp svneol=native#text/plain tests/webtbs/tw3506.pp svneol=native#text/plain +tests/webtbs/tw35136.pp svneol=native#text/pascal tests/webtbs/tw35139.pp svneol=native#text/plain tests/webtbs/tw35139a.pp svneol=native#text/plain tests/webtbs/tw35149.pp svneol=native#text/plain diff --git a/rtl/inc/iso7185.pp b/rtl/inc/iso7185.pp index 8e08875b3b..f00b78aa24 100644 --- a/rtl/inc/iso7185.pp +++ b/rtl/inc/iso7185.pp @@ -144,7 +144,7 @@ unit iso7185; else begin OldCtrlZMarksEof:=CtrlZMarksEOF; - CtrlZMarksEof:=false; + CtrlZMarksEof:=true; Eof:=System.Eof(t); CtrlZMarksEof:=OldCtrlZMarksEOF; end; diff --git a/tests/webtbs/tw35136.pp b/tests/webtbs/tw35136.pp new file mode 100644 index 0000000000..bcd86a1175 --- /dev/null +++ b/tests/webtbs/tw35136.pp @@ -0,0 +1,16 @@ +{ %opt=-Miso } +program p; +var f: text; +begin + rewrite(f); + f^ := 'a'; + put(f); + reset(f); + if eof(f) then writeln('premature eof'); + writeln(f^); + if eof(f) then writeln('premature eof'); + writeln(f^); + if eof(f) then writeln('premature eof'); + get(f); + if eof(f) then writeln('eof correctly set') else begin writeln('eof should be set, but isn''t'); halt(1); end; +end.