diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-10-28 19:32:58 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-10-28 19:32:58 +0000 |
commit | c61c7549a893beca6b9101917387bceb3b16b644 (patch) | |
tree | aad34a58d03292a0f0040cebb7f868e82fb69a46 /lib/System/Unix | |
parent | 7289d06e4824060247ab449e1b56f3e1a9e6073c (diff) | |
download | external_llvm-c61c7549a893beca6b9101917387bceb3b16b644.zip external_llvm-c61c7549a893beca6b9101917387bceb3b16b644.tar.gz external_llvm-c61c7549a893beca6b9101917387bceb3b16b644.tar.bz2 |
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix')
-rw-r--r-- | lib/System/Unix/Program.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index 110a6d1..3741bf8 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 |