[llvm-commits] [llvm] r74645 - /llvm/trunk/lib/Support/SystemUtils.cpp

Daniel Dunbar daniel at zuster.org
Wed Jul 1 14:36:28 PDT 2009


Author: ddunbar
Date: Wed Jul  1 16:36:28 2009
New Revision: 74645

URL: http://llvm.org/viewvc/llvm-project?rev=74645&view=rev
Log:
Tweak FindExecutable so that relative executable paths work as well.

Modified:
    llvm/trunk/lib/Support/SystemUtils.cpp

Modified: llvm/trunk/lib/Support/SystemUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SystemUtils.cpp?rev=74645&r1=74644&r2=74645&view=diff

==============================================================================
--- llvm/trunk/lib/Support/SystemUtils.cpp (original)
+++ llvm/trunk/lib/Support/SystemUtils.cpp Wed Jul  1 16:36:28 2009
@@ -43,9 +43,10 @@
 #undef FindExecutable   // needed on windows :(
 sys::Path llvm::FindExecutable(const std::string &ExeName,
                                const std::string &ProgramPath) {
-  // First check if the given name is a fully qualified path to an executable
+  // First check if the given name is already a valid path to an executable.
   sys::Path Result(ExeName);
-  if (Result.isAbsolute() && Result.canExecute())
+  Result.makeAbsolute();
+  if (Result.canExecute())
     return Result;
 
   // Otherwise check the directory that the calling program is in.  We can do





More information about the llvm-commits mailing list