diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-15 20:39:36 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-15 20:39:36 +0000 |
commit | 28f0ed5c9de4a68f34c0219d4ab83652c4647150 (patch) | |
tree | 999622dc7275347a61e4a674455c7beaf7ded075 /lib/Archive/Archive.cpp | |
parent | b6516aeef12a05aa47515f76e18fc426d85babbd (diff) |
Support/PathV2: Add identify_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r-- | lib/Archive/Archive.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp index 3ee3cb25c5..1eab27d3eb 100644 --- a/lib/Archive/Archive.cpp +++ b/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; |