aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/b64.lua2
-rw-r--r--etc/dict.lua5
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 @@
1require("ltn12")
2require("mime")
1local source = ltn12.source.file(io.stdin) 3local source = ltn12.source.file(io.stdin)
2local sink = ltn12.sink.file(io.stdout) 4local sink = ltn12.sink.file(io.stdout)
3local convert 5local 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
19end 18end