Browse Source

* Patch from maillist for read() on a file with only a few numerical digits
in them and no crlf

git-svn-id: trunk@15 -

marco 20 years ago
parent
commit
9d33cf03b1
1 changed files with 2 additions and 3 deletions
  1. 2 3
      rtl/inc/text.inc

+ 2 - 3
rtl/inc/text.inc

@@ -755,6 +755,7 @@ End;
 
 
 Function NextChar(var f:Text;var s:string):Boolean;
 Function NextChar(var f:Text;var s:string):Boolean;
 begin
 begin
+  NextChar:=false;
   if (TextRec(f).BufPos<TextRec(f).BufEnd) then
   if (TextRec(f).BufPos<TextRec(f).BufEnd) then
    if not (CtrlZMarksEOF) or (TextRec(f).Bufptr^[TextRec(f).BufPos]<>#26) then
    if not (CtrlZMarksEOF) or (TextRec(f).Bufptr^[TextRec(f).BufPos]<>#26) then
     begin
     begin
@@ -767,9 +768,7 @@ begin
      If TextRec(f).BufPos>=TextRec(f).BufEnd Then
      If TextRec(f).BufPos>=TextRec(f).BufEnd Then
       FileFunc(TextRec(f).InOutFunc)(TextRec(f));
       FileFunc(TextRec(f).InOutFunc)(TextRec(f));
      NextChar:=true;
      NextChar:=true;
-   end
-  else
-   NextChar:=false;
+   end;
 end;
 end;