mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 02:31:49 +01:00 
			
		
		
		
	* fixed occassional crash during InitArguments
git-svn-id: trunk@2112 -
This commit is contained in:
		
							parent
							
								
									6d3ae16267
								
							
						
					
					
						commit
						6d96ee4819
					
				| @ -526,16 +526,10 @@ begin | |||||||
|   PC := PChar (PIB^.Cmd) + ArgLen; |   PC := PChar (PIB^.Cmd) + ArgLen; | ||||||
| 
 | 
 | ||||||
| (* ArgLen contains size of command line arguments including leading space. *) | (* ArgLen contains size of command line arguments including leading space. *) | ||||||
|   ArgLen := StrLen (PC); |   ArgLen := Succ (StrLen (PC)); | ||||||
| (* Just to make sure the leading space is there for all OS/2 versions... *) |  | ||||||
|   if PC^ <> ' ' then |  | ||||||
|    begin |  | ||||||
|     CmdLine [ArgVLen] := ' '; |  | ||||||
|     Inc (ArgVLen); |  | ||||||
|    end; |  | ||||||
| 
 | 
 | ||||||
|   SysReallocMem (CmdLine, ArgVLen + ArgLen); |   SysReallocMem (CmdLine, ArgVLen + ArgLen); | ||||||
| (* Ending #0 after program name gets overwritten with space from PIB^.Cmd. *) | 
 | ||||||
|   Move (PC^, CmdLine [ArgVLen], Succ (ArgLen)); |   Move (PC^, CmdLine [ArgVLen], Succ (ArgLen)); | ||||||
| 
 | 
 | ||||||
| (* ArgV has space for 8 parameters from the first allocation. *) | (* ArgV has space for 8 parameters from the first allocation. *) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Tomas Hajny
						Tomas Hajny