mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: FileIsUnixExecutable function result with zero size file
This commit is contained in:
parent
9bb9d0f9bc
commit
c0c13d5e17
1 changed files with 3 additions and 2 deletions
|
|
@ -290,9 +290,10 @@ var
|
|||
fsExeScr : TFileStreamEx = nil;
|
||||
begin
|
||||
// First check FileName is not a directory and then check if executable
|
||||
Result:= (fpStat(UTF8ToSys(FileName), Info) <> -1) and FPS_ISREG(Info.st_mode) and
|
||||
Result:= (fpStat(UTF8ToSys(FileName), Info) <> -1) and
|
||||
(FPS_ISREG(Info.st_mode)) and (Info.st_size >= SizeOf(dwSign)) and
|
||||
(BaseUnix.fpAccess(UTF8ToSys(FileName), BaseUnix.X_OK) = 0);
|
||||
if Result and (Info.st_size >= SizeOf(dwSign)) then
|
||||
if Result then
|
||||
try
|
||||
fsExeScr := TFileStreamEx.Create(FileName, fmOpenRead or fmShareDenyNone);
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue