aboutsummaryrefslogtreecommitdiff
path: root/src/mime.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/mime.lua')
-rw-r--r--src/mime.lua14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mime.lua b/src/mime.lua
index ecf310d..000404f 100644
--- a/src/mime.lua
+++ b/src/mime.lua
@@ -6,23 +6,15 @@
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7 7
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Load MIME from dynamic library
10-- Comment these lines if you are loading static
11-----------------------------------------------------------------------------
12local open = assert(loadlib("mime", "luaopen_mime"))
13local mime = assert(open())
14
15-----------------------------------------------------------------------------
16-- Load other required modules 9-- Load other required modules
17----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local mime = requirelib("mime", "luaopen_mime", getfenv(1))
18local ltn12 = require("ltn12") 12local ltn12 = require("ltn12")
19 13
20----------------------------------------------------------------------------- 14-----------------------------------------------------------------------------
21-- Setup namespace 15-- Setup namespace
22----------------------------------------------------------------------------- 16-----------------------------------------------------------------------------
23-- make all module globals fall into mime namespace 17_LOADED["mime"] = mime
24setmetatable(mime, { __index = _G })
25setfenv(1, mime)
26 18
27-- encode, decode and wrap algorithm tables 19-- encode, decode and wrap algorithm tables
28encodet = {} 20encodet = {}
@@ -48,7 +40,7 @@ end
48 40
49encodet['quoted-printable'] = function(mode) 41encodet['quoted-printable'] = function(mode)
50 return ltn12.filter.cycle(qp, "", 42 return ltn12.filter.cycle(qp, "",
51 (mode == "binary") and "=0D=0A" or "\13\10") 43 (mode == "binary") and "=0D=0A" or "\r\n")
52end 44end
53 45
54-- define the decoding filters 46-- define the decoding filters