UPD: Prepare FPC 3.0 support

This commit is contained in:
Alexander Koblov 2015-11-26 19:14:58 +00:00
commit 641b0adfbb
2 changed files with 5 additions and 5 deletions

View file

@ -205,7 +205,7 @@ end;
{$ELSEIF DEFINED(UNIX)}
function GetFileInfo(const FileName: String; out FileInfo: BaseUnix.Stat): Boolean;
begin
Result:= fpLStat(PAnsiChar(UTF8ToSys(FileName)), FileInfo) >= 0;
Result:= fpLStat(UTF8ToSys(FileName), FileInfo) >= 0;
end;
{$ENDIF}

View file

@ -199,8 +199,8 @@ begin
// Get user home directory
sHomeDir:= GetHomeDir;
// Check if file in home directory
if (fpLStat(PChar(UTF8ToSys(sHomeDir)), st1) >= 0)
and (fpLStat(PChar(UTF8ToSys(FileName)), st2) >= 0)
if (fpLStat(UTF8ToSys(sHomeDir), st1) >= 0)
and (fpLStat(UTF8ToSys(FileName), st2) >= 0)
and (st1.st_dev = st2.st_dev) then
begin
// Get trash directory in $XDG_DATA_HOME
@ -219,7 +219,7 @@ begin
sTopDir:= FindMountPointPath(FileName);
// Try to use "$topdir/.Trash/$uid" directory
sTemp:= sTopDir + trashFolder;
if (fpLStat(PChar(UTF8ToSys(sTemp)), st1) >= 0)
if (fpLStat(UTF8ToSys(sTemp), st1) >= 0)
and fpS_ISDIR(st1.st_mode) and not fpS_ISLNK(st1.st_mode) then
begin
sTemp:= sTemp + PathDelim + sUserID;
@ -234,7 +234,7 @@ begin
end;
// Try to use "$topdir/.Trash-$uid" directory
sTemp:= sTopDir + trashFolder + '-' + sUserID;
if ((fpLStat(PChar(UTF8ToSys(sTemp)), st1) >= 0) and fpS_ISDIR(st1.st_mode)
if ((fpLStat(UTF8ToSys(sTemp), st1) >= 0) and fpS_ISDIR(st1.st_mode)
and not fpS_ISLNK(st1.st_mode)) or mbCreateDir(sTemp) then
begin
// Create destination directories if needed