diff options
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.122 2000/08/28 17:57:04 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.123 2000/08/29 14:33:31 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -333,7 +333,6 @@ int luaB_call (lua_State *L) { | |||
333 | for (i=0; i<n; i++) | 333 | for (i=0; i<n; i++) |
334 | *(L->top++) = *luaH_getnum(arg, i+1); | 334 | *(L->top++) = *luaH_getnum(arg, i+1); |
335 | status = lua_call(L, n, LUA_MULTRET); | 335 | status = lua_call(L, n, LUA_MULTRET); |
336 | n = lua_gettop(L) - oldtop; /* number of results */ | ||
337 | if (err != 0) { /* restore old error method */ | 336 | if (err != 0) { /* restore old error method */ |
338 | lua_pushobject(L, err); | 337 | lua_pushobject(L, err); |
339 | lua_setglobal(L, LUA_ERRORMESSAGE); | 338 | lua_setglobal(L, LUA_ERRORMESSAGE); |
@@ -347,12 +346,11 @@ int luaB_call (lua_State *L) { | |||
347 | } | 346 | } |
348 | else { /* no errors */ | 347 | else { /* no errors */ |
349 | if (strchr(options, 'p')) { /* pack results? */ | 348 | if (strchr(options, 'p')) { /* pack results? */ |
350 | luaV_pack(L, luaA_index(L, oldtop+1), n, L->top); | 349 | luaV_pack(L, luaA_index(L, oldtop+1)); |
351 | incr_top; | ||
352 | return 1; /* only table is returned */ | 350 | return 1; /* only table is returned */ |
353 | } | 351 | } |
354 | else | 352 | else |
355 | return n; /* results are already on the stack */ | 353 | return lua_gettop(L) - oldtop; /* results are already on the stack */ |
356 | } | 354 | } |
357 | } | 355 | } |
358 | 356 | ||