mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-26 16:33:45 +01:00 
			
		
		
		
	Always write filename, truncate directory part if needed
git-svn-id: trunk@34362 -
This commit is contained in:
		
							parent
							
								
									8d1467157c
								
							
						
					
					
						commit
						eefdf135a5
					
				| @ -44,6 +44,9 @@ implementation | ||||
|                             Filename registration | ||||
| *****************************************************************************} | ||||
| 
 | ||||
| 
 | ||||
|     { We need to avoid using memory allocation here | ||||
|       and thus use a fixed size static array } | ||||
|     const | ||||
|       MaxFiles = 1024; | ||||
|       MaxNameLength = 39; | ||||
| @ -62,11 +65,24 @@ implementation | ||||
| 
 | ||||
| 
 | ||||
|     procedure ppheap_register_file(name : string;index : longint); | ||||
|       var | ||||
|         len,pos : longint; | ||||
|       begin | ||||
|         inc(last_index); | ||||
|         if last_index <= MaxFiles then | ||||
|           begin | ||||
|             fileinfoarray[last_index].name:=copy(name,1,MaxNameLength); | ||||
|             { Keep last part of name if too long } | ||||
|             len:=length(name); | ||||
|             if len>MaxNameLength then | ||||
|               begin | ||||
|                 pos:=len-MaxNameLength+4; | ||||
|                 fileinfoarray[last_index].name:='...'+copy(name,pos,MaxNameLength); | ||||
|               end | ||||
|             else | ||||
|               begin | ||||
|                 pos:=1; | ||||
|                 fileinfoarray[last_index].name:=copy(name,pos,MaxNameLength); | ||||
|               end; | ||||
|             fileinfoarray[last_index].index:=index; | ||||
|           end | ||||
|         else | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 pierre
						pierre