mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 14:50:38 +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(Var t: Text): Boolean;
|
||||||
Function Eof:Boolean;
|
Function Eof:Boolean;
|
||||||
|
Function Eoln(Var t: Text): Boolean;
|
||||||
|
Function Eoln:Boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -83,6 +85,23 @@ unit iso7185;
|
|||||||
Eof:=Eof(Input);
|
Eof:=Eof(Input);
|
||||||
End;
|
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
|
begin
|
||||||
{ we shouldn't do this because it might confuse user programs, but for now it
|
{ 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 }
|
is good enough to get pretty unique tmp file names }
|
||||||
|
@ -1420,7 +1420,17 @@ Begin
|
|||||||
If TextRec(f).Bufptr^[TextRec(f).BufPos]=#26 then
|
If TextRec(f).Bufptr^[TextRec(f).BufPos]=#26 then
|
||||||
inc(TextRec(f).BufPos);
|
inc(TextRec(f).BufPos);
|
||||||
end
|
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:=' ';
|
c:=' ';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user