summaryrefslogtreecommitdiff
path: root/lib/Archive/ArchiveWriter.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-17 16:43:30 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-17 16:43:30 +0000
commit02e27ed21be144e0ce6586f6f29c2d1ba45a395e (patch)
tree5b95afa503ce0c00d7eef2f1115a46c9ffe16a68 /lib/Archive/ArchiveWriter.cpp
parent3c00a83c3362dc7d066454936ad36fbfb3fd26c5 (diff)
Archive: Fix temp path names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/ArchiveWriter.cpp')
-rw-r--r--lib/Archive/ArchiveWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 59fb7bdd3ff..c5ad5fc41cd 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -364,8 +364,9 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Create a temporary file to store the archive in
SmallString<128> TempArchivePath;
int ArchFD;
- if (error_code ec = sys::fs::unique_file("%%-%%-%%-%%" + archPath.str(),
- ArchFD, TempArchivePath)) {
+ if (error_code ec =
+ sys::fs::unique_file("%%-%%-%%-%%-" + sys::path::filename(archPath.str()),
+ ArchFD, TempArchivePath)) {
if (ErrMsg) *ErrMsg = ec.message();
return true;
}
@@ -421,8 +422,9 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Open another temporary file in order to avoid invalidating the
// mmapped data
- if (error_code ec = sys::fs::unique_file("%%-%%-%%-%%" + archPath.str(),
- ArchFD, TempArchiveWithSymbolTablePath)) {
+ if (error_code ec =
+ sys::fs::unique_file("%%-%%-%%-%%-" + sys::path::filename(archPath.str()),
+ ArchFD, TempArchiveWithSymbolTablePath)) {
if (ErrMsg) *ErrMsg = ec.message();
return true;
}