From 4aef67c99da6ab6f21042d56ff80dc846087bb71 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 1 Jul 2009 21:36:28 +0000 Subject: Tweak FindExecutable so that relative executable paths work as well. llvm-svn: 74645 --- llvm/lib/Support/SystemUtils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/SystemUtils.cpp') diff --git a/llvm/lib/Support/SystemUtils.cpp b/llvm/lib/Support/SystemUtils.cpp index 5dcd3347258..c8c323876bf 100644 --- a/llvm/lib/Support/SystemUtils.cpp +++ b/llvm/lib/Support/SystemUtils.cpp @@ -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 -- cgit v1.2.3