diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-28 01:49:21 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-28 01:49:21 +0000 |
commit | 4213618088b0c0c85b208a01b45d89972984831b (patch) | |
tree | d302131b9b8b8702307adeae64946a470282c170 /lib/Support/Path.cpp | |
parent | bf0184b6841a729bd09efff59fc4906e091024ec (diff) |
Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r-- | lib/Support/Path.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index c3353fd0e2..3e0ee8dd86 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -140,7 +140,11 @@ sys::IdentifyFileType(const char *magic, unsigned length) { bool Path::isArchive() const { - return hasMagicNumber("!<arch>\012"); + std::string Magic; + if (getMagicNumber(Magic, 8)) + if (IdentifyFileType(Magic.c_str(), Magic.length()) == Archive_FileType) + return true; + return false; } bool |