aboutsummaryrefslogtreecommitdiff
path: root/ltablib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltablib.c')
-rw-r--r--ltablib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ltablib.c b/ltablib.c
index a288633a..e2da6081 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.52 2009/12/18 16:53:12 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.53 2009/12/28 16:30:31 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -178,6 +178,8 @@ static int pack (lua_State *L) {
178 for (; top >= 1; top--) /* assign elements */ 178 for (; top >= 1; top--) /* assign elements */
179 lua_rawseti(L, LUA_ENVIRONINDEX, top); 179 lua_rawseti(L, LUA_ENVIRONINDEX, top);
180 lua_pushvalue(L, LUA_ENVIRONINDEX); /* return new table */ 180 lua_pushvalue(L, LUA_ENVIRONINDEX); /* return new table */
181 /* remove new table from environment to allow its later collection */
182 lua_copy(L, LUA_REGISTRYINDEX, LUA_ENVIRONINDEX);
181 return 1; 183 return 1;
182} 184}
183 185