Revert the archive part of "Support/PathV2: Add identify_magic."
[oota-llvm.git] / lib / Archive / Archive.cpp
index 1eab27d3eba3a59d36e527f27ce6d361992bcf8c..3ee3cb25c5a059e5eccbf3f9129f1cdd2c1de74c 100644 (file)
@@ -116,10 +116,11 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
 
   // Get the signature and status info
   const char* signature = (const char*) data;
-  SmallString<4> magic;
+  std::string magic;
   if (!signature) {
-    sys::fs::get_magic(path.str(), magic.capacity(), magic);
+    path.getMagicNumber(magic,4);
     signature = magic.c_str();
+    std::string err;
     const sys::FileStatus *FSinfo = path.getFileStatus(false, ErrMsg);
     if (FSinfo)
       info = *FSinfo;