diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-12 17:57:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-12 17:57:40 -0300 |
commit | a3addae03634794b841b6c8c4dd8ff83542d8896 (patch) | |
tree | 66695864f7bd56c295ad7cd6a6465845103cd424 /lbaselib.c | |
parent | ad40bb1181d08821af6789147a28aa8370533d11 (diff) | |
download | lua-a3addae03634794b841b6c8c4dd8ff83542d8896.tar.gz lua-a3addae03634794b841b6c8c4dd8ff83542d8896.tar.bz2 lua-a3addae03634794b841b6c8c4dd8ff83542d8896.zip |
lua_gettable and similars return type of gotten value
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.283 2014/02/13 12:11:34 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.284 2014/02/14 16:45:38 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -246,8 +246,7 @@ static int ipairsaux (lua_State *L) { | |||
246 | luaL_checktype(L, 1, LUA_TTABLE); | 246 | luaL_checktype(L, 1, LUA_TTABLE); |
247 | i++; /* next value */ | 247 | i++; /* next value */ |
248 | lua_pushinteger(L, i); | 248 | lua_pushinteger(L, i); |
249 | lua_rawgeti(L, 1, i); | 249 | return (lua_rawgeti(L, 1, i) == LUA_TNIL) ? 1 : 2; |
250 | return (lua_isnil(L, -1)) ? 1 : 2; | ||
251 | } | 250 | } |
252 | 251 | ||
253 | 252 | ||