diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/b64.lua | 4 | ||||
-rw-r--r-- | etc/check-links.lua | 4 | ||||
-rw-r--r-- | etc/dict.lua | 4 | ||||
-rw-r--r-- | etc/qp.lua | 4 |
4 files changed, 12 insertions, 4 deletions
diff --git a/etc/b64.lua b/etc/b64.lua index 1993b01..b86b870 100644 --- a/etc/b64.lua +++ b/etc/b64.lua | |||
@@ -10,5 +10,5 @@ else | |||
10 | local wrap = mime.wrap() | 10 | local wrap = mime.wrap() |
11 | convert = ltn12.filter.chain(base64, wrap) | 11 | convert = ltn12.filter.chain(base64, wrap) |
12 | end | 12 | end |
13 | source = ltn12.source.chain(source, convert) | 13 | sink = ltn12.sink.chain(convert, sink) |
14 | repeat until not ltn12.pump(source, sink) | 14 | ltn12.pump.all(source, sink) |
diff --git a/etc/check-links.lua b/etc/check-links.lua index 03ca6de..c200dfb 100644 --- a/etc/check-links.lua +++ b/etc/check-links.lua | |||
@@ -4,6 +4,10 @@ | |||
4 | -- Author: Diego Nehab | 4 | -- Author: Diego Nehab |
5 | -- RCS ID: $Id$ | 5 | -- RCS ID: $Id$ |
6 | ----------------------------------------------------------------------------- | 6 | ----------------------------------------------------------------------------- |
7 | |||
8 | require"luasocket" | ||
9 | require"http" | ||
10 | |||
7 | socket.http.TIMEOUT = 10 | 11 | socket.http.TIMEOUT = 10 |
8 | 12 | ||
9 | cache = {} | 13 | cache = {} |
diff --git a/etc/dict.lua b/etc/dict.lua index d11ac93..31359d9 100644 --- a/etc/dict.lua +++ b/etc/dict.lua | |||
@@ -4,6 +4,8 @@ | |||
4 | -- Author: Diego Nehab | 4 | -- Author: Diego Nehab |
5 | -- RCS ID: $Id$ | 5 | -- RCS ID: $Id$ |
6 | ----------------------------------------------------------------------------- | 6 | ----------------------------------------------------------------------------- |
7 | require"luasocket" | ||
8 | |||
7 | function get_status(sock, valid) | 9 | function get_status(sock, valid) |
8 | local line, err = sock:receive() | 10 | local line, err = sock:receive() |
9 | local code, par | 11 | local code, par |
@@ -12,7 +14,7 @@ function get_status(sock, valid) | |||
12 | code = tonumber(code) | 14 | code = tonumber(code) |
13 | if code ~= valid then return code end | 15 | if code ~= valid then return code end |
14 | if code == 150 then | 16 | if code == 150 then |
15 | par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)")) | 17 | par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)"))) |
16 | end | 18 | end |
17 | return nil, par | 19 | return nil, par |
18 | end | 20 | end |
@@ -1,3 +1,5 @@ | |||
1 | require("ltn12") | ||
2 | require("mime") | ||
1 | local convert | 3 | local convert |
2 | arg = arg or {} | 4 | arg = arg or {} |
3 | local mode = arg and arg[1] or "-et" | 5 | local mode = arg and arg[1] or "-et" |
@@ -13,4 +15,4 @@ elseif mode == "-eb" then | |||
13 | else convert = mime.decode("quoted-printable") end | 15 | else convert = mime.decode("quoted-printable") end |
14 | local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert) | 16 | local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert) |
15 | local sink = ltn12.sink.file(io.stdout) | 17 | local sink = ltn12.sink.file(io.stdout) |
16 | ltn12.pump(source, sink) | 18 | ltn12.pump.all(source, sink) |