From 657f65211a5d836899d29b0a020a9ea4dff8cf51 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 16 Nov 2001 14:29:51 -0200 Subject: bug: `next' did not work for numeric indices --- ltable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index a4828fca..486b09a8 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.86 2001/09/07 17:30:16 roberto Exp $ +** $Id: ltable.c,v 1.87 2001/10/25 19:14:14 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -96,7 +96,7 @@ int luaH_index (lua_State *L, Table *t, const TObject *key) { if (ttype(key) == LUA_TNIL) return -1; /* first iteration */ i = arrayindex(key); if (0 <= i && i < t->sizearray) { /* is `key' inside array part? */ - return i; /* yes; that's the index */ + return i-1; /* yes; that's the index (corrected to C) */ } else { const TObject *v = luaH_get(t, key); -- cgit v1.2.3-55-g6feb