aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lbaselib.c b/lbaselib.c
index fd6687e6..912c4cc6 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -285,7 +285,8 @@ static int luaB_pairs (lua_State *L) {
285** Traversal function for 'ipairs' 285** Traversal function for 'ipairs'
286*/ 286*/
287static int ipairsaux (lua_State *L) { 287static int ipairsaux (lua_State *L) {
288 lua_Integer i = luaL_checkinteger(L, 2) + 1; 288 lua_Integer i = luaL_checkinteger(L, 2);
289 i = luaL_intop(+, i, 1);
289 lua_pushinteger(L, i); 290 lua_pushinteger(L, i);
290 return (lua_geti(L, 1, i) == LUA_TNIL) ? 1 : 2; 291 return (lua_geti(L, 1, i) == LUA_TNIL) ? 1 : 2;
291} 292}