lcl: fix range checking error in win FileUtils, reported at #15642

git-svn-id: trunk@27251 -
This commit is contained in:
dmitry 2010-09-02 18:34:56 +00:00
parent bf1bdb52a7
commit 41cba2bb5e
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,4 @@
{%MainUnit ../filectrl.pp}
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
procedure CheckIfFileIsExecutable(const AFilename: string); procedure CheckIfFileIsExecutable(const AFilename: string);
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}

View File

@ -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;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------