From a5382b763c2faa4c47e55ee0e49889b4c47daac4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 5 Oct 2009 13:44:33 -0300 Subject: new function lua_copy --- lauxlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index ed82e8cd..2d33adf6 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.191 2009/09/18 18:58:45 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.192 2009/09/28 12:36:40 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -75,8 +75,8 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { lua_getinfo(L, "f", ar); /* push function */ lua_pushvalue(L, LUA_GLOBALSINDEX); /* push global table */ if (findfield(L, top + 1, 2)) { - lua_replace(L, top + 1); /* move name to proper place */ - lua_pop(L, 1); /* remove other pushed value */ + lua_copy(L, -1, top + 1); /* move name to proper place */ + lua_pop(L, 2); /* remove pushed values */ return 1; } else { -- cgit v1.2.3-55-g6feb