1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: MIME-based pattern loading not working correctly

Fixes #1574
This commit is contained in:
WerWolv 2024-02-28 20:54:51 +01:00
parent dc1a5a860c
commit 40592a93ac

View File

@ -1305,7 +1305,7 @@ namespace hex::plugin::builtin {
pl::PatternLanguage runtime; pl::PatternLanguage runtime;
ContentRegistry::PatternLanguage::configureRuntime(runtime, provider); ContentRegistry::PatternLanguage::configureRuntime(runtime, provider);
auto mimeType = magic::getMIMEType(provider, true); auto mimeType = magic::getMIMEType(provider, 0, 100_KiB, true);
bool foundCorrectType = false; bool foundCorrectType = false;
runtime.addPragma("MIME", [&mimeType, &foundCorrectType](const pl::PatternLanguage &runtime, const std::string &value) { runtime.addPragma("MIME", [&mimeType, &foundCorrectType](const pl::PatternLanguage &runtime, const std::string &value) {