From b12776f29cda9157ccf6fdd4776f4f4ae73a326a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 18 Mar 2003 15:48:31 -0300 Subject: `luaL_getmetafield' was leaving extra value on the stack --- lauxlib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lauxlib.c b/lauxlib.c index 291d232d..5975db04 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.95 2003/02/11 15:32:31 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.96 2003/03/18 12:25:32 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -202,7 +202,10 @@ LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { lua_pop(L, 2); /* remove metatable and metafield */ return 0; } - return 1; + else { + lua_remove(L, -2); /* remove only metatable */ + return 1; + } } -- cgit v1.2.3-55-g6feb