mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 15:56:10 +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);
|
procedure CheckIfFileIsExecutable(const AFilename: string);
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{%MainUnit ../filectrl.pp}
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
procedure CheckIfFileIsExecutable(const AFilename: string);
|
procedure CheckIfFileIsExecutable(const AFilename: string);
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -285,7 +286,7 @@ begin
|
|||||||
FindWideToAnsi(wide, Rslt.FindData);
|
FindWideToAnsi(wide, Rslt.FindData);
|
||||||
Result := FindMatch(Rslt);
|
Result := FindMatch(Rslt);
|
||||||
end else
|
end else
|
||||||
Result := GetLastError;
|
Result := Integer(GetLastError);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -312,7 +313,7 @@ end;
|
|||||||
|
|
||||||
function FileGetAttrWide(const FileName: String): Longint;
|
function FileGetAttrWide(const FileName: String): Longint;
|
||||||
begin
|
begin
|
||||||
Result:=Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName)));
|
Result:=Integer(Windows.GetFileAttributesW(PWideChar(UTF8Decode(FileName))));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -328,7 +329,7 @@ begin
|
|||||||
if Windows.SetFileAttributesW(PWideChar(UTF8Decode(FileName)), Attr) then
|
if Windows.SetFileAttributesW(PWideChar(UTF8Decode(FileName)), Attr) then
|
||||||
Result:=0
|
Result:=0
|
||||||
else
|
else
|
||||||
Result := Windows.GetLastError;
|
Result := Integer(Windows.GetLastError);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user