summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-16 21:13:51 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-16 21:13:51 +0000
commit405e958ac3a43ff553245aea39c1cee88506b2f2 (patch)
tree906f8f89f3006f2c4dceddcc010655fb8d194021 /llvm/lib/Archive/Archive.cpp
parent12a620fd587a6bd9eb686e08c5820e0ecfe01586 (diff)
downloadbcm5719-llvm-405e958ac3a43ff553245aea39c1cee88506b2f2.tar.gz
bcm5719-llvm-405e958ac3a43ff553245aea39c1cee88506b2f2.zip
UnRevert "Revert the archive part of "Support/PathV2: Add identify_magic.""
This reverts commit dd103021a889a986a181ce36ed7b0e8dc9b645e1. llvm-svn: 123595
Diffstat (limited to 'llvm/lib/Archive/Archive.cpp')
-rw-r--r--llvm/lib/Archive/Archive.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Archive/Archive.cpp b/llvm/lib/Archive/Archive.cpp
index 3ee3cb25c5a..1eab27d3eba 100644
--- a/llvm/lib/Archive/Archive.cpp
+++ b/llvm/lib/Archive/Archive.cpp
@@ -116,11 +116,10 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
// Get the signature and status info
const char* signature = (const char*) data;
- std::string magic;
+ SmallString<4> magic;
if (!signature) {
- path.getMagicNumber(magic,4);
+ sys::fs::get_magic(path.str(), magic.capacity(), magic);
signature = magic.c_str();
- std::string err;
const sys::FileStatus *FSinfo = path.getFileStatus(false, ErrMsg);
if (FSinfo)
info = *FSinfo;
OpenPOWER on IntegriCloud