lcl: fix range cheking errors for windows file operations

git-svn-id: trunk@27256 -
This commit is contained in:
dmitry 2010-09-03 09:27:25 +00:00
parent ea83850a40
commit 02308cd07e

View File

@ -494,10 +494,10 @@ end;
function FileExistsUTF8(const Filename: string): boolean;
var
Attr:Dword;
Attr: Longint;
begin
Attr:=FileGetAttrUTF8(FileName);
if Attr <> $ffffffff then
if Attr <> -1 then
Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0
else
Result:=False;
@ -505,10 +505,10 @@ end;
function DirectoryExistsUTF8(const Directory: string): boolean;
var
Attr:Dword;
Attr: Longint;
begin
Attr:=FileGetAttrUTF8(Directory);
if Attr <> $ffffffff then
if Attr <> -1 then
Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) > 0
else
Result:=False;