mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
detail (use new returned value from 'lua_getglobal' )
This commit is contained in:
parent
b401d37188
commit
87b179e71d
5
lua.c
5
lua.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.220 2014/11/02 19:19:04 roberto Exp roberto $
|
** $Id: lua.c,v 1.221 2014/11/02 19:33:33 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -422,8 +422,7 @@ static void doREPL (lua_State *L) {
|
|||||||
*/
|
*/
|
||||||
static int pushargs (lua_State *L) {
|
static int pushargs (lua_State *L) {
|
||||||
int i, n;
|
int i, n;
|
||||||
lua_getglobal(L, "arg");
|
if (lua_getglobal(L, "arg") != LUA_TTABLE)
|
||||||
if (!lua_istable(L, -1))
|
|
||||||
luaL_error(L, "'arg' is not a table");
|
luaL_error(L, "'arg' is not a table");
|
||||||
n = (int)luaL_len(L, -1);
|
n = (int)luaL_len(L, -1);
|
||||||
luaL_checkstack(L, n + 3, "too many arguments to script");
|
luaL_checkstack(L, n + 3, "too many arguments to script");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user