mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 09:51:34 +01:00 
			
		
		
		
	
							parent
							
								
									8167e6ea09
								
							
						
					
					
						commit
						70ca5f79e9
					
				| @ -915,16 +915,19 @@ Function ReadPCharLen(var f:Text;s:pchar;maxlen:longint):longint; | ||||
| var | ||||
|   sPos,len : Longint; | ||||
|   p,q,startp,maxp : pchar; | ||||
|   stop_chars:array[0..3] of char; | ||||
|   stop_chars:array[0..2] of char; | ||||
|   end_of_string:boolean; | ||||
| Begin | ||||
|   {Avoid use of ctrlZmarkseof in the inner loop.} | ||||
|   stop_chars[0]:=#13;
 | ||||
|   stop_chars[1]:=#10;
 | ||||
|   stop_chars[2]:=#0;
 | ||||
| { #10 must be always the last valid element in stop_chars - see below. }
 | ||||
|   if ctrlZmarkseof then | ||||
|     stop_chars[2]:=#26;
 | ||||
|   stop_chars[3]:=#0;
 | ||||
|    begin | ||||
|     stop_chars[1]:=#26;
 | ||||
|     stop_chars[2]:=#10;
 | ||||
|    end | ||||
|   else | ||||
|    stop_chars[1]:=#10;
 | ||||
|   ReadPCharLen:=0; | ||||
|   If not CheckRead(f) then | ||||
|     exit; | ||||
| @ -950,7 +953,9 @@ Begin | ||||
|     while p<maxp do | ||||
|       begin | ||||
|         q:=@stop_chars[0]; | ||||
|         while (q^<>#0) and (p^<>q^) do
 | ||||
| { The following line relies on the fact that stop_chars array | ||||
|   is always initialized to have #10 as the last valid element. }
 | ||||
|         while (q^<>#10) and (p^<>q^) do
 | ||||
|           inc(q); | ||||
|         if p^=q^ then | ||||
|           begin | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Tomas Hajny
						Tomas Hajny