Skip to content

Commit

Permalink
Check for execute rights using fpAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamma committed Aug 2, 2024
1 parent 8c43d5d commit 8ef1e8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parted.commons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
interface

uses
{$ifdef Unix}Unix,{$endif}
{$ifdef Unix}Unix, BaseUnix, {$endif}
SysUtils, Classes, Generics.Collections, Process, Types, StrUtils, RegExpr, Locale;

type
Expand Down Expand Up @@ -293,7 +293,7 @@ function FindProgramViaEnv(const Prog: String): String;
for S in Paths do
begin
Path := S + '/' + Prog;
if FileExists(Path) then
if fpAccess(Path, X_OK) = 0 then
begin
PathDict.Add(Prog, Path);
Exit(Path);
Expand Down

0 comments on commit 8ef1e8c

Please sign in to comment.