From 4e56c0d51412817a238f9de6453aaa16704a770d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 29 Aug 2000 11:41:56 -0300 Subject: better implementation for luaV_pack --- lbuiltin.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lbuiltin.c') diff --git a/lbuiltin.c b/lbuiltin.c index 81f05568..b0399941 100644 --- a/lbuiltin.c +++ b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.122 2000/08/28 17:57:04 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.123 2000/08/29 14:33:31 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -333,7 +333,6 @@ int luaB_call (lua_State *L) { for (i=0; itop++) = *luaH_getnum(arg, i+1); status = lua_call(L, n, LUA_MULTRET); - n = lua_gettop(L) - oldtop; /* number of results */ if (err != 0) { /* restore old error method */ lua_pushobject(L, err); lua_setglobal(L, LUA_ERRORMESSAGE); @@ -347,12 +346,11 @@ int luaB_call (lua_State *L) { } else { /* no errors */ if (strchr(options, 'p')) { /* pack results? */ - luaV_pack(L, luaA_index(L, oldtop+1), n, L->top); - incr_top; + luaV_pack(L, luaA_index(L, oldtop+1)); return 1; /* only table is returned */ } else - return n; /* results are already on the stack */ + return lua_gettop(L) - oldtop; /* results are already on the stack */ } } -- cgit v1.2.3-55-g6feb