summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-10-28 19:32:58 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-10-28 19:32:58 +0000
commitd7faab5c9578cb66827cc9b44d548fed31d5b358 (patch)
treee89cd31ba8fe7e343d91072a127d1af7c3a7692b
parent0e9d9b51ebfdc0a4575077b7f350712cde1e9e05 (diff)
downloadbcm5719-llvm-d7faab5c9578cb66827cc9b44d548fed31d5b358.tar.gz
bcm5719-llvm-d7faab5c9578cb66827cc9b44d548fed31d5b358.zip
Revert r77396.
Original commit message: On "Unix", if Program::FindProgramByName is given a name containing slashes, just go with it, regardless of whether it looks like it will be executable. This follows the behavior of sh(1) more closely. It's better when behaviour is consistent between platforms. This change also makes FindExecutable() behave as expected on unix-likes (before this commit, it used to always succeed). llvm-svn: 117582
-rw-r--r--llvm/lib/System/Unix/Program.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc
index 110a6d14f48..3741bf8e6ba 100644
--- a/llvm/lib/System/Unix/Program.inc
+++ b/llvm/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
OpenPOWER on IntegriCloud