aboutsummaryrefslogtreecommitdiff
path: root/src/mime.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/mime.lua')
-rw-r--r--src/mime.lua12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mime.lua b/src/mime.lua
index d3abac5..93539de 100644
--- a/src/mime.lua
+++ b/src/mime.lua
@@ -10,7 +10,6 @@
10local base = _G 10local base = _G
11local ltn12 = require("ltn12") 11local ltn12 = require("ltn12")
12local mime = require("mime.core") 12local mime = require("mime.core")
13local string = require("string")
14local _M = mime 13local _M = mime
15 14
16-- encode, decode and wrap algorithm tables 15-- encode, decode and wrap algorithm tables
@@ -18,7 +17,7 @@ local encodet, decodet, wrapt = {},{},{}
18 17
19_M.encodet = encodet 18_M.encodet = encodet
20_M.decodet = decodet 19_M.decodet = decodet
21_M.wrapt = wrapt 20_M.wrapt = wrapt
22 21
23-- creates a function that chooses a filter by name from a given table 22-- creates a function that chooses a filter by name from a given table
24local function choose(table) 23local function choose(table)
@@ -27,7 +26,7 @@ local function choose(table)
27 name, opt1, opt2 = "default", name, opt1 26 name, opt1, opt2 = "default", name, opt1
28 end 27 end
29 local f = table[name or "nil"] 28 local f = table[name or "nil"]
30 if not f then 29 if not f then
31 base.error("unknown key (" .. base.tostring(name) .. ")", 3) 30 base.error("unknown key (" .. base.tostring(name) .. ")", 3)
32 else return f(opt1, opt2) end 31 else return f(opt1, opt2) end
33 end 32 end
@@ -52,13 +51,6 @@ decodet['quoted-printable'] = function()
52 return ltn12.filter.cycle(_M.unqp, "") 51 return ltn12.filter.cycle(_M.unqp, "")
53end 52end
54 53
55local function format(chunk)
56 if chunk then
57 if chunk == "" then return "''"
58 else return string.len(chunk) end
59 else return "nil" end
60end
61
62-- define the line-wrap filters 54-- define the line-wrap filters
63wrapt['text'] = function(length) 55wrapt['text'] = function(length)
64 length = length or 76 56 length = length or 76