aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/System/Unix/Program.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 110a6d14f4..3741bf8e6b 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -63,7 +63,7 @@ Program::FindProgramByName(const std::string& progName) {
return Path();
// Use the given path verbatim if it contains any slashes; this matches
// the behavior of sh(1) and friends.
- if (progName.find('/') != std::string::npos)
+ if (progName.find('/') != std::string::npos && temp.canExecute())
return temp;
// At this point, the file name does not contain slashes. Search for it