diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-11 17:41:27 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-11-11 17:41:27 -0200 |
commit | 87b179e71d7b3b6d1432b7500e6f77596e85e773 (patch) | |
tree | 515ed060b9a8edfd23d9a64ddaa9cd36d32f02a9 /lua.c | |
parent | b401d37188fd83288ac99fdabaff46a5cf98bd94 (diff) | |
download | lua-87b179e71d7b3b6d1432b7500e6f77596e85e773.tar.gz lua-87b179e71d7b3b6d1432b7500e6f77596e85e773.tar.bz2 lua-87b179e71d7b3b6d1432b7500e6f77596e85e773.zip |
detail (use new returned value from 'lua_getglobal' )
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"); |