]> git.saurik.com Git - redis.git/commitdiff
Multi bulk to Lua table now working
authorantirez <antirez@gmail.com>
Sun, 1 May 2011 13:48:26 +0000 (15:48 +0200)
committerantirez <antirez@gmail.com>
Wed, 25 May 2011 10:32:46 +0000 (12:32 +0200)
src/scripting.c

index 9269cbf143af888301e0b49dfff6c7e1b399dd54..9b1fb12d465827cf9f22f347fd461bf0b3003a5a 100644 (file)
@@ -98,17 +98,15 @@ char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
     long long mbulklen;
     int j = 0;
 
-    printf("--%s-- (%d)\n", reply,(int)(p-reply-1));
     string2ll(reply+1,p-reply-1,&mbulklen);
     p += 2;
     if (mbulklen == -1) {
         lua_pushnil(lua);
         return p;
     }
-    printf("BL: %lld\n", mbulklen);
     lua_newtable(lua);
     for (j = 0; j < mbulklen; j++) {
-        lua_pushnumber(lua,j);
+        lua_pushnumber(lua,j+1);
         p = redisProtocolToLuaType(lua,p);
         lua_settable(lua,-3);
     }