projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3791000
)
Multi bulk to Lua table now working
author
antirez
<antirez@gmail.com>
Sun, 1 May 2011 13:48:26 +0000
(15:48 +0200)
committer
antirez
<antirez@gmail.com>
Wed, 25 May 2011 10:32:46 +0000
(12:32 +0200)
src/scripting.c
patch
|
blob
|
blame
|
history
diff --git
a/src/scripting.c
b/src/scripting.c
index 9269cbf143af888301e0b49dfff6c7e1b399dd54..9b1fb12d465827cf9f22f347fd461bf0b3003a5a 100644
(file)
--- a/
src/scripting.c
+++ b/
src/scripting.c
@@
-98,17
+98,15
@@
char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
long long mbulklen;
int j = 0;
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;
}
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_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);
}
p = redisProtocolToLuaType(lua,p);
lua_settable(lua,-3);
}