mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 06:12:31 +02:00
lcl: fix range checking error in win FileUtils, reported at #15642
git-svn-id: trunk@27251 -
This commit is contained in:
parent
bf1bdb52a7
commit
41cba2bb5e
@ -1,3 +1,4 @@
|
||||
{%MainUnit ../filectrl.pp}
|
||||
{------------------------------------------------------------------------------
|
||||
procedure CheckIfFileIsExecutable(const AFilename: string);
|
||||
------------------------------------------------------------------------------}
|
||||
|
@ -1,3 +1,4 @@
|
||||
{%MainUnit ../filectrl.pp}
|
||||
{------------------------------------------------------------------------------
|
||||
procedure CheckIfFileIsExecutable(const AFilename: string);
|
||||
------------------------------------------------------------------------------}
|
||||
@ -285,7 +286,7 @@ begin
|
||||
FindWideToAnsi(wide, Rslt.FindData);
|
||||
Result := FindMatch(Rslt);
|
||||
end else
|
||||
Result := GetLastError;
|
||||
Result := Integer(GetLastError);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -312,7 +313,7 @@ end;
|
||||
|
||||
function FileGetAttrWide(const FileName: String): Longint;
|
||||
begin
|
||||
Result:=Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName)));
|
||||
Result:=Integer(Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName))));
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -328,7 +329,7 @@ begin
|
||||
if Windows.SetFileAttributesW(PWideChar(UTF8Decode(FileName)), Attr) then
|
||||
Result:=0
|
||||
else
|
||||
Result := Windows.GetLastError;
|
||||
Result := Integer(Windows.GetLastError);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user