Tweak FindExecutable so that relative executable paths work as well.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 1 Jul 2009 21:36:28 +0000 (21:36 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 1 Jul 2009 21:36:28 +0000 (21:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74645 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/SystemUtils.cpp

index 5dcd3347258621052ca2c0b00c3e8212246c687b..c8c323876bfb25aa34eb64aedee445f4123d1ab8 100644 (file)
@@ -43,9 +43,10 @@ bool llvm::CheckBitcodeOutputToConsole(std::ostream* stream_to_check,
 #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