Browse Source

* changed InputFileBufSize from 32kb to 32kb+1byte, because the last
byte is used for zero-termination (so we now always read blocks of
exactly 32kb from disk)
* set the first byte of the buffer to #0 when opening a file initially

git-svn-id: trunk@13576 -

Jonas Maebe 16 years ago
parent
commit
8dbc728926
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/finput.pas

+ 2 - 1
compiler/finput.pas

@@ -29,7 +29,7 @@ interface
       cutils,cclasses;
       cutils,cclasses;
 
 
     const
     const
-       InputFileBufSize=32*1024;
+       InputFileBufSize=32*1024+1;
        linebufincrease=512;
        linebufincrease=512;
 
 
     type
     type
@@ -268,6 +268,7 @@ uses
         endoffile:=false;
         endoffile:=false;
         closed:=false;
         closed:=false;
         Getmem(buf,MaxBufsize);
         Getmem(buf,MaxBufsize);
+        buf[0]:=#0;
         bufstart:=0;
         bufstart:=0;
         bufsize:=0;
         bufsize:=0;
         open:=true;
         open:=true;