From 4283a774fdfd5582ab516387a7a77969c40bb56f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 9 Sep 2019 15:08:05 +0100 Subject: [PATCH] [Minor] Lua_magic: Some minor fixes --- lualib/lua_magic/init.lua | 4 ++-- lualib/lua_magic/patterns.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lualib/lua_magic/init.lua b/lualib/lua_magic/init.lua index 27f968149..0784b4a77 100644 --- a/lualib/lua_magic/init.lua +++ b/lualib/lua_magic/init.lua @@ -326,9 +326,9 @@ exports.detect_mime_part = function(part, log_obj) return ext,types[ext] end - ext,weight = exports.detect(part:get_content(), log_obj) + ext = exports.detect(part:get_content(), log_obj) - if ext and weight and weight > 20 then + if ext then return ext,types[ext] end diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua index 630f287ce..1ac18c8ea 100644 --- a/lualib/lua_magic/patterns.lua +++ b/lualib/lua_magic/patterns.lua @@ -209,8 +209,8 @@ local patterns = { zst = { matches = { { - string = [[\x{FD}\x{2F}\x{B5}[\x{22}-\x{40}].]], - position = 5, -- includes last . + string = [[[\x{22}-\x{40}]\x{B5}\x{2F}\x{FD}]], + position = 4, weight = 60, }, } -- 2.39.5