diff options
Diffstat (limited to 'src/mime.lua')
-rw-r--r-- | src/mime.lua | 12 |
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 @@ | |||
10 | local base = _G | 10 | local base = _G |
11 | local ltn12 = require("ltn12") | 11 | local ltn12 = require("ltn12") |
12 | local mime = require("mime.core") | 12 | local mime = require("mime.core") |
13 | local string = require("string") | ||
14 | local _M = mime | 13 | local _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 |
24 | local function choose(table) | 23 | local 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, "") |
53 | end | 52 | end |
54 | 53 | ||
55 | local function format(chunk) | ||
56 | if chunk then | ||
57 | if chunk == "" then return "''" | ||
58 | else return string.len(chunk) end | ||
59 | else return "nil" end | ||
60 | end | ||
61 | |||
62 | -- define the line-wrap filters | 54 | -- define the line-wrap filters |
63 | wrapt['text'] = function(length) | 55 | wrapt['text'] = function(length) |
64 | length = length or 76 | 56 | length = length or 76 |