From 2faf05b58fefd83fbe62f791bdef029b5de4a71c Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Sat, 16 Apr 2011 12:49:03 +0200 Subject: [PATCH] [luci] bugfix to make luci.json.encode() work like expected --- mote/v2/openwrt/package/luci/libs/json/luasrc/json.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mote/v2/openwrt/package/luci/libs/json/luasrc/json.lua b/mote/v2/openwrt/package/luci/libs/json/luasrc/json.lua index 5b09285..9e38339 100644 --- a/mote/v2/openwrt/package/luci/libs/json/luasrc/json.lua +++ b/mote/v2/openwrt/package/luci/libs/json/luasrc/json.lua @@ -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