diff options
author | Jason Stephenson <j.stephenson@live.co.uk> | 2022-07-22 14:29:08 +0100 |
---|---|---|
committer | Jason Stephenson <j.stephenson@live.co.uk> | 2022-07-22 14:29:08 +0100 |
commit | 3158d56ea48f8c90ff0274f76041c052e580de4b (patch) | |
tree | bd9efbaa10607199b57f383c7b179d0e37834b1b /lualib/rspamadm | |
parent | 6460f4088b8f8fcaa167ee0cef3505d7ded9d6ec (diff) | |
download | rspamd-3158d56ea48f8c90ff0274f76041c052e580de4b.tar.gz rspamd-3158d56ea48f8c90ff0274f76041c052e580de4b.zip |
luacheck fixes
Diffstat (limited to 'lualib/rspamadm')
-rw-r--r-- | lualib/rspamadm/mime.lua | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua index 19409eb88..44140829b 100644 --- a/lualib/rspamadm/mime.lua +++ b/lualib/rspamadm/mime.lua @@ -890,7 +890,7 @@ end -- ../home/very_simple.eml --All the above end up as very_simple local function filename_only(filepath) - filename = filepath:match(".*%/([^%.]+)") + local filename = filepath:match(".*%/([^%.]+)") if not filename then filename = filepath:match("([^%.]+)") end @@ -899,8 +899,7 @@ end --Write the dump content to file or standard out local function write_dump_content(dump_content, fname, extension, outdir) - - wrote_filepath = nil + local wrote_filepath = nil if outdir then if outdir:sub(-1) ~= "/" then outdir = outdir .. "/" @@ -920,7 +919,7 @@ local function write_dump_content(dump_content, fname, extension, outdir) else io.write(dump_content) end - +luacheck return wrote_filepath end @@ -928,8 +927,7 @@ end local function get_dump_content(task, opts, fname) if opts.ucl or opts.json or opts.messagepack then local ucl_object = lua_mime.message_to_ucl(task) - - --Split out the content field into separate raws and update the ucl + -- Split out the content field into separate raws and update the ucl if opts.split then for i, part in ipairs(ucl_object.parts) do if part.content then @@ -955,7 +953,6 @@ local function dump_handler(opts) for _,fname in ipairs(opts.file) do local task = load_task(opts, fname) - local data, extension = get_dump_content(task, opts, fname) write_dump_content(data, fname, extension, opts.outdir) |