diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-07-28 22:08:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-07-28 22:08:15 +0000 |
commit | 6adb6e07ce1f7c30ac2ff064a375fb96806f16fa (patch) | |
tree | 42cefbd85be7ce8e97c64d403523409b6e1e6692 /llvm/lib/System | |
parent | f869caa03fd01d2997ff34828fb6022d5272865e (diff) | |
download | bcm5719-llvm-6adb6e07ce1f7c30ac2ff064a375fb96806f16fa.tar.gz bcm5719-llvm-6adb6e07ce1f7c30ac2ff064a375fb96806f16fa.zip |
Fix a fixme; don't take binaries from the working directory.
This fixes clang on non-darwin platforms if a file called 'ld' or 'as'
is in the working directory. Based on patch by Pawel Worach!
llvm-svn: 77379
Diffstat (limited to 'llvm/lib/System')
-rw-r--r-- | llvm/lib/System/Unix/Program.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index d4e88fd6d13..7e82ef3f935 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -45,9 +45,9 @@ Program::FindProgramByName(const std::string& progName) { Path temp; if (!temp.set(progName)) // invalid name return Path(); - // FIXME: have to check for absolute filename - we cannot assume anything - // about "." being in $PATH - if (temp.canExecute()) // already executable as is + // 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()) return temp; // At this point, the file name is valid and its not executable |