On "Unix", if Program::FindProgramByName is given a name containing
authorDan Gohman <gohman@apple.com>
Tue, 28 Jul 2009 23:25:18 +0000 (23:25 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 28 Jul 2009 23:25:18 +0000 (23:25 +0000)
slashes, just go with it, regardless of whether it looks like it will
be executable. This follows the behavior of sh(1) more closely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77396 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Program.inc

index 7e82ef3f9353839ff7fc0265c6423fafe3ba62ce..3c5a54cffc1a88102b958b0fb9260045a5230c0f 100644 (file)
@@ -47,7 +47,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 && temp.canExecute())
+  if (progName.find('/') != std::string::npos)
     return temp;
 
   // At this point, the file name is valid and its not executable