diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/b64.lua | 2 | ||||
-rw-r--r-- | etc/dict.lua | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/etc/b64.lua b/etc/b64.lua index 3f861b4..1993b01 100644 --- a/etc/b64.lua +++ b/etc/b64.lua | |||
@@ -1,3 +1,5 @@ | |||
1 | require("ltn12") | ||
2 | require("mime") | ||
1 | local source = ltn12.source.file(io.stdin) | 3 | local source = ltn12.source.file(io.stdin) |
2 | local sink = ltn12.sink.file(io.stdout) | 4 | local sink = ltn12.sink.file(io.stdout) |
3 | local convert | 5 | local convert |
diff --git a/etc/dict.lua b/etc/dict.lua index 933c1c8..d11ac93 100644 --- a/etc/dict.lua +++ b/etc/dict.lua | |||
@@ -8,12 +8,11 @@ function get_status(sock, valid) | |||
8 | local line, err = sock:receive() | 8 | local line, err = sock:receive() |
9 | local code, par | 9 | local code, par |
10 | if not line then sock:close() return err end | 10 | if not line then sock:close() return err end |
11 | _, _, code = string.find(line, "^(%d%d%d)") | 11 | code = socket.skip(2, string.find(line, "^(%d%d%d)")) |
12 | code = tonumber(code) | 12 | code = tonumber(code) |
13 | if code ~= valid then return code end | 13 | if code ~= valid then return code end |
14 | if code == 150 then | 14 | if code == 150 then |
15 | _,_,_, par = string.find(line, "^(%d%d%d) (%d*)") | 15 | par = tonumber(socket.skip(2, string.find(line, "^%d%d%d (%d*)")) |
16 | par = tonumber(par) | ||
17 | end | 16 | end |
18 | return nil, par | 17 | return nil, par |
19 | end | 18 | end |