Fix FPC TempDir

This commit is contained in:
2018-03-30 12:56:16 +03:00
parent 62a5d170ba
commit baf108a37f
4 changed files with 57 additions and 82 deletions

View File

@@ -759,22 +759,7 @@ var
{$ENDIF}{$ENDIF}
initialization
{$IFDEF FPC}
{$IFDEF MSWINDOWS}
begin
SetLength(FasmTemp,MAX_PATH);
Len:=GetTempPath(MAX_PATH,PChar(FasmTemp));
if Len<>0 then
begin
Len:=GetLongPathNameA(PChar(FasmTemp),nil,0);
GetLongPathNameA(PChar(FasmTemp),PChar(FasmTemp),Len);
SetLength(FasmTemp,Len-1);
end
else
FasmTemp:='';
end;
{$ELSE}
FasmTemp:='/tmp/';
{$ENDIF}
GetTempDir;
{$ELSE}
FasmTemp:=TPath.GetTempPath;
{$ENDIF}