aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lstate.c b/lstate.c
index bc56079f..b571c828 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.60 2009/09/28 13:50:19 roberto Exp roberto $ 2** $Id: lstate.c,v 2.61 2009/09/30 20:49:47 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -100,8 +100,7 @@ static int cpcall (lua_State *L) {
100 lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); 100 lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1);
101 lua_remove(L, 1); /* remove f from stack */ 101 lua_remove(L, 1); /* remove f from stack */
102 /* restore original environment for 'cpcall' */ 102 /* restore original environment for 'cpcall' */
103 lua_pushvalue(L, LUA_GLOBALSINDEX); 103 lua_copy(L, LUA_GLOBALSINDEX, LUA_ENVIRONINDEX);
104 lua_replace(L, LUA_ENVIRONINDEX);
105 return f(L); 104 return f(L);
106} 105}
107 106