This commit is contained in:
Roberto Ierusalimschy
2002-11-26 10:53:29 -02:00
parent c194a46bc5
commit 1f55dbc699
2 changed files with 7 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.110 2002/11/25 17:33:33 roberto Exp roberto $
** $Id: lbaselib.c,v 1.111 2002/11/26 08:45:36 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -223,7 +223,7 @@ static int luaB_pairs (lua_State *L) {
static int luaB_ipairs (lua_State *L) {
lua_Number i = lua_tonumber(L, 2);
luaL_checktype(L, 1, LUA_TTABLE);
if (i == 0 && lua_isnull(L, 2)) { /* `for' start? */
if (i == 0 && lua_isnone(L, 2)) { /* `for' start? */
lua_getglobal(L, "ipairs"); /* return generator, */
lua_pushvalue(L, 1); /* state, */
lua_pushnumber(L, 0); /* and initial value */