From 25c557ec6367870c127e879cce8ed8fa21f34398 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 12 Mar 2010 16:14:06 -0300 Subject: first version of _ENV; no more global variables --- lbaselib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 0554ba55..a14ce31d 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.234 2009/12/22 15:32:50 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.235 2009/12/28 16:30:31 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -376,7 +376,7 @@ static int luaB_loadin (lua_State *L) { n = luaB_load_aux(L, 2); if (n == 1) { /* success? */ lua_pushvalue(L, 1); /* environment for loaded function */ - lua_setfenv(L, -2); + lua_setupvalue(L, -2, 1); } return n; } -- cgit v1.2.3-55-g6feb