From 415bcce9f46adc023de100c535ac53981ce8851f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 24 Sep 2019 15:59:58 +0100 Subject: [PATCH] [Minor] Lua_magic: Add bat files detection --- lualib/lua_magic/patterns.lua | 9 +++++++++ lualib/lua_magic/types.lua | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua index 8d90a45ef..47026478b 100644 --- a/lualib/lua_magic/patterns.lua +++ b/lualib/lua_magic/patterns.lua @@ -129,6 +129,15 @@ local patterns = { }, } }, + bat = { + matches = { + { + string = [[(?i)@\s*ECHO\s+OFF]], + position = {'>=', 0}, + weight = 60, + }, + } + }, class = { -- Technically, this also matches MachO files, but I don't care about -- Apple and their mental health problems here: just consider Java files, diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 5626b3445..4ed378ecd 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -47,6 +47,10 @@ local types = { ct = 'application/vnd.android.package-archive', type = 'archive', }, + bat = { + ct = 'application/x-bat', + type = 'executable', + }, -- text rtf = { ct = "application/rtf", -- 2.39.5