diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-04-17 11:39:17 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-04-17 11:39:17 +0000 |
commit | fdf625ea67dadc19252bbd3977fa1214ad151d0b (patch) | |
tree | 2dda0b596d1fdb08fd5713b7d466dfe402b23ce8 /libs/json/luasrc/json.lua | |
parent | 3a12f82014cbac58080ef19673e0ff86fcae1112 (diff) |
libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode() work like expected (#220)
Diffstat (limited to 'libs/json/luasrc/json.lua')
-rw-r--r-- | libs/json/luasrc/json.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/json/luasrc/json.lua b/libs/json/luasrc/json.lua index 5b0928590f..9e38339be7 100644 --- a/libs/json/luasrc/json.lua +++ b/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 |