lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 5e4ea9a831b1c1538a2a8b1250336f3954c74319
parent 6311e3109f4eb9a356b28d471e82d130d1198647
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue, 15 Jun 2004 10:36:59 -0300

`setn' returns its "self" (the table)

Diffstat:
Mltablib.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ltablib.c b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.24 2004/05/10 17:50:51 roberto Exp roberto $ +** $Id: ltablib.c,v 1.25 2004/05/10 18:06:14 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -63,7 +63,8 @@ static int luaB_getn (lua_State *L) { static int luaB_setn (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_setn(L, 1, luaL_checkint(L, 2)); - return 0; + lua_pushvalue(L, 1); + return 1; }