提交 fdf625ea 编写于 作者: J Jo-Philipp Wich

libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode()...

libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode() work like expected (#220)
上级 3a12f820
......@@ -82,7 +82,7 @@ function encode(obj, ...)
repeat
chnk, err = e()
out[#out+1] = chnk
until chnk
until not chnk
return not err and table.concat(out) or nil
end
......@@ -141,7 +141,7 @@ end
function Encoder.put(self, chunk)
if self.buffersize < 2 then
corountine.yield(chunk)
coroutine.yield(chunk)
else
if #self.buffer + #chunk > self.buffersize then
local written = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册