diff options
| author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-11-02 20:32:39 +0000 |
|---|---|---|
| committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-11-02 20:32:39 +0000 |
| commit | a581d8a27aa6c7d582ee73136e888821493f31bb (patch) | |
| tree | 785608408c3c7ed03dba97acf9fe41c1f5b0788a /llvm/lib/System/Win32 | |
| parent | b4921a035e0142b270ece4b574a4ea06ed20aa72 (diff) | |
| download | bcm5719-llvm-a581d8a27aa6c7d582ee73136e888821493f31bb.tar.gz bcm5719-llvm-a581d8a27aa6c7d582ee73136e888821493f31bb.zip | |
Make FindProgramByName return paths with slashes unmodified on Windows.
This makes its behaviour more consistent across platforms.
llvm-svn: 118048
Diffstat (limited to 'llvm/lib/System/Win32')
| -rw-r--r-- | llvm/lib/System/Win32/Program.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/System/Win32/Program.inc b/llvm/lib/System/Win32/Program.inc index b55aa2fa80f..2d6e665377e 100644 --- a/llvm/lib/System/Win32/Program.inc +++ b/llvm/lib/System/Win32/Program.inc @@ -67,10 +67,12 @@ Program::FindProgramByName(const std::string& progName) { Path temp; if (!temp.set(progName)) // invalid name return Path(); - if (temp.canExecute()) // already executable as is + // Return paths with slashes verbatim. + if (progName.find('\\') != std::string::npos || + progName.find('/') != std::string::npos) return temp; - // At this point, the file name is valid and its not executable. + // At this point, the file name is valid and does not contain slashes. // Let Windows search for it. char buffer[MAX_PATH]; char *dummy = NULL; |

