gatherer: use absolute path in magic guess

This commit is contained in:
bvr-yr 2024-05-12 12:28:59 +03:00 committed by Mihai Fufezan
parent c87af3aa1f
commit 0477df2ca4

View file

@ -163,7 +163,7 @@ void CAsyncResourceGatherer::gather() {
auto handle = magic_open(MAGIC_NONE | MAGIC_COMPRESS); auto handle = magic_open(MAGIC_NONE | MAGIC_COMPRESS);
magic_load(handle, nullptr); magic_load(handle, nullptr);
const auto type_str = std::string(magic_file(handle, path.c_str())); const auto type_str = std::string(magic_file(handle, ABSOLUTEPATH.c_str()));
const auto first_word = type_str.substr(0, type_str.find(" ")); const auto first_word = type_str.substr(0, type_str.find(" "));
magic_close(handle); magic_close(handle);