Changeset 6988

Show
Ignore:
Timestamp:
04/17/11 13:39:17 (2 years ago)
Author:
jow
Message:

libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode() work like expected (#220)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/json/luasrc/json.lua

    r5537 r6988  
    8383        chnk, err = e() 
    8484        out[#out+1] = chnk 
    85     until chnk 
     85    until not chnk 
    8686    return not err and table.concat(out) or nil 
    8787end 
     
    142142function Encoder.put(self, chunk) 
    143143    if self.buffersize < 2 then 
    144         corountine.yield(chunk) 
     144        coroutine.yield(chunk) 
    145145    else 
    146146        if #self.buffer + #chunk > self.buffersize then