forhappy / zklua

Lua binding of apache zookeeper.
Apache License 2.0
99 stars 47 forks source link

fix lua table index for build_string vector #10

Open rgnine opened 10 years ago

rgnine commented 10 years ago

Another issue where lua tables start at index 0 instead of 1. This caused checks for example for number of children in ret, children = zklua.get_children(zh, path, 0) to return 0 to a subsequent size check with #children as the table is { 0 -> firstchild }

With this change, the first children entry will be pushed to lua index 1 and #children will work as expected as will all standard lua iterator functions that expect arrays to start at 1.