aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-11-02 20:32:39 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-11-02 20:32:39 +0000
commit9cd59712289214225094b5b4108c2dbbf06a052c (patch)
tree9c56a6c5b666ef6617bb2e35a487c1c01734aa82 /lib/System/Win32
parent0f2ec15b9e22e80ffcb7332500f47c165b8ee945 (diff)
downloadexternal_llvm-9cd59712289214225094b5b4108c2dbbf06a052c.zip
external_llvm-9cd59712289214225094b5b4108c2dbbf06a052c.tar.gz
external_llvm-9cd59712289214225094b5b4108c2dbbf06a052c.tar.bz2
Make FindProgramByName return paths with slashes unmodified on Windows.
This makes its behaviour more consistent across platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Program.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/System/Win32/Program.inc b/lib/System/Win32/Program.inc
index b55aa2f..2d6e665 100644
--- a/lib/System/Win32/Program.inc
+++ b/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;