diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-10-05 13:44:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-10-05 13:44:33 -0300 |
commit | a5382b763c2faa4c47e55ee0e49889b4c47daac4 (patch) | |
tree | d5f4ea49f2343593ced46ce303783baf0cb2cd56 /lauxlib.c | |
parent | ba21aa8b2b29f516f1f488f996fc899c62f7105b (diff) | |
download | lua-a5382b763c2faa4c47e55ee0e49889b4c47daac4.tar.gz lua-a5382b763c2faa4c47e55ee0e49889b4c47daac4.tar.bz2 lua-a5382b763c2faa4c47e55ee0e49889b4c47daac4.zip |
new function lua_copy
Diffstat (limited to '')
-rw-r--r-- | lauxlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.191 2009/09/18 18:58:45 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.192 2009/09/28 12:36:40 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -75,8 +75,8 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { | |||
75 | lua_getinfo(L, "f", ar); /* push function */ | 75 | lua_getinfo(L, "f", ar); /* push function */ |
76 | lua_pushvalue(L, LUA_GLOBALSINDEX); /* push global table */ | 76 | lua_pushvalue(L, LUA_GLOBALSINDEX); /* push global table */ |
77 | if (findfield(L, top + 1, 2)) { | 77 | if (findfield(L, top + 1, 2)) { |
78 | lua_replace(L, top + 1); /* move name to proper place */ | 78 | lua_copy(L, -1, top + 1); /* move name to proper place */ |
79 | lua_pop(L, 1); /* remove other pushed value */ | 79 | lua_pop(L, 2); /* remove pushed values */ |
80 | return 1; | 80 | return 1; |
81 | } | 81 | } |
82 | else { | 82 | else { |