From 8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 25 Jul 2010 12:18:19 -0300 Subject: 'lua_[gs]etenv' -> 'lua_[gs]etuservalue' --- liolib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'liolib.c') diff --git a/liolib.c b/liolib.c index a26aff5a..48687bf8 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.88 2010/03/26 20:58:11 roberto Exp roberto $ +** $Id: liolib.c,v 2.89 2010/07/02 11:38:13 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -120,7 +120,7 @@ static FILE **newprefile (lua_State *L) { static FILE **newfile (lua_State *L) { FILE **pf = newprefile(L); lua_pushvalue(L, lua_upvalueindex(1)); /* set upvalue... */ - lua_setenv(L, -2); /* ... as environment for new file */ + lua_setuservalue(L, -2); /* ... as environment for new file */ return pf; } @@ -163,7 +163,7 @@ static int io_fclose (lua_State *L) { static int aux_close (lua_State *L) { - lua_getenv(L, 1); + lua_getuservalue(L, 1); lua_getfield(L, -1, "__close"); return (lua_tocfunction(L, -1))(L); } @@ -595,7 +595,7 @@ static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { lua_rawseti(L, 1, k); /* add it to common upvalue */ } lua_pushvalue(L, 3); /* get environment for default files */ - lua_setenv(L, -2); /* set it as environment for file */ + lua_setuservalue(L, -2); /* set it as environment for file */ lua_setfield(L, 2, fname); /* add file to module */ } -- cgit v1.2.3-55-g6feb