summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 88137eac9a5..6d10c0e67bb 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -665,7 +665,8 @@ static error_code
createTemporaryFile(const Twine &Prefix, StringRef Suffix, int &ResultFD,
llvm::SmallVectorImpl<char> &ResultPath,
FSEntity Type) {
- return createTemporaryFile(Prefix + "-%%%%%%." + Suffix, ResultFD, ResultPath,
+ const char *Middle = Suffix.empty() ? "-%%%%%%" : "-%%%%%%.";
+ return createTemporaryFile(Prefix + Middle + Suffix, ResultFD, ResultPath,
Type);
}
OpenPOWER on IntegriCloud