diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.220 2014/11/02 19:19:04 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.221 2014/11/02 19:33:33 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -422,8 +422,7 @@ static void doREPL (lua_State *L) { | |||
422 | */ | 422 | */ |
423 | static int pushargs (lua_State *L) { | 423 | static int pushargs (lua_State *L) { |
424 | int i, n; | 424 | int i, n; |
425 | lua_getglobal(L, "arg"); | 425 | if (lua_getglobal(L, "arg") != LUA_TTABLE) |
426 | if (!lua_istable(L, -1)) | ||
427 | luaL_error(L, "'arg' is not a table"); | 426 | luaL_error(L, "'arg' is not a table"); |
428 | n = (int)luaL_len(L, -1); | 427 | n = (int)luaL_len(L, -1); |
429 | luaL_checkstack(L, n + 3, "too many arguments to script"); | 428 | luaL_checkstack(L, n + 3, "too many arguments to script"); |