Don't append a dot on platforms which don't use exe suffixes.
authorDan Gohman <gohman@apple.com>
Tue, 2 Nov 2010 20:49:48 +0000 (20:49 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 2 Nov 2010 20:49:48 +0000 (20:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118057 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/SystemUtils.cpp

index db61e7569cd4acda179ca30a2d049e812643a9f6..8d70616421f32412cf3ab8bf32d7bc3a18f59b2f 100644 (file)
@@ -47,7 +47,9 @@ sys::Path llvm::FindExecutable(const std::string &ExeName,
 
   if (!Result.isEmpty()) {
     Result.appendComponent(ExeName);
-    Result.appendSuffix(sys::Path::GetEXESuffix());
+    StringRef EXESuffix = sys::Path::GetEXESuffix();
+    if (!EXESuffix.empty())
+      Result.appendSuffix(EXESuffix);
   }
 
   return Result;