projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make FindProgramByName return paths with slashes unmodified on Windows.
[oota-llvm.git]
/
lib
/
System
/
Win32
/
Program.inc
diff --git
a/lib/System/Win32/Program.inc
b/lib/System/Win32/Program.inc
index b55aa2fa80ff4d781b517d33746c55a07c8be9cf..2d6e665377e01a230aff012b849bdad3eb0a4b38 100644
(file)
--- 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();
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;
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;
// Let Windows search for it.
char buffer[MAX_PATH];
char *dummy = NULL;