mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Support/PathV2: Add identify_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user