* fix iso i/o with unix style line feeds

git-svn-id: trunk@15706 -
This commit is contained in:
florian 2010-08-03 21:43:36 +00:00
parent 348301c511
commit 9e053edf2e
2 changed files with 30 additions and 1 deletions

View File

@ -31,6 +31,8 @@ unit iso7185;
Function Eof(Var t: Text): Boolean;
Function Eof:Boolean;
Function Eoln(Var t: Text): Boolean;
Function Eoln:Boolean;
implementation
@ -83,6 +85,23 @@ unit iso7185;
Eof:=Eof(Input);
End;
Function Eoln(Var t: Text): Boolean;[IOCheck];
var
OldCtrlZMarksEof : Boolean;
Begin
OldCtrlZMarksEof:=CtrlZMarksEOF;
CtrlZMarksEof:=true;
Eoln:=System.Eoln(t);
CtrlZMarksEof:=OldCtrlZMarksEOF;
end;
Function Eoln:Boolean;
Begin
Eoln:=Eoln(Input);
End;
begin
{ we shouldn't do this because it might confuse user programs, but for now it
is good enough to get pretty unique tmp file names }

View File

@ -1420,7 +1420,17 @@ Begin
If TextRec(f).Bufptr^[TextRec(f).BufPos]=#26 then
inc(TextRec(f).BufPos);
end
else if c in [#10,#26] then
else if c=#10 then
begin
c:=' ';
{ ignore #26 following a new line }
If not CheckRead(f) or
(TextRec(f).BufPos>=TextRec(f).BufEnd) then
exit;
If TextRec(f).Bufptr^[TextRec(f).BufPos]=#26 then
inc(TextRec(f).BufPos);
end
else if c=#26 then
c:=' ';
end;