mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 03:48:07 +02:00
* fix iso i/o with unix style line feeds
git-svn-id: trunk@15706 -
This commit is contained in:
parent
348301c511
commit
9e053edf2e
@ -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 }
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user