aboutsummaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-07-25 12:18:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-07-25 12:18:19 -0300
commit8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3 (patch)
tree6e91b533df43594cd6341c7dc149407b54ba7759 /liolib.c
parent73b0a3451d0bd59f1540271aa3b8d8de36b36580 (diff)
downloadlua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.tar.gz
lua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.tar.bz2
lua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.zip
'lua_[gs]etenv' -> 'lua_[gs]etuservalue'
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/liolib.c b/liolib.c
index a26aff5a..48687bf8 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.88 2010/03/26 20:58:11 roberto Exp roberto $ 2** $Id: liolib.c,v 2.89 2010/07/02 11:38:13 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -120,7 +120,7 @@ static FILE **newprefile (lua_State *L) {
120static FILE **newfile (lua_State *L) { 120static FILE **newfile (lua_State *L) {
121 FILE **pf = newprefile(L); 121 FILE **pf = newprefile(L);
122 lua_pushvalue(L, lua_upvalueindex(1)); /* set upvalue... */ 122 lua_pushvalue(L, lua_upvalueindex(1)); /* set upvalue... */
123 lua_setenv(L, -2); /* ... as environment for new file */ 123 lua_setuservalue(L, -2); /* ... as environment for new file */
124 return pf; 124 return pf;
125} 125}
126 126
@@ -163,7 +163,7 @@ static int io_fclose (lua_State *L) {
163 163
164 164
165static int aux_close (lua_State *L) { 165static int aux_close (lua_State *L) {
166 lua_getenv(L, 1); 166 lua_getuservalue(L, 1);
167 lua_getfield(L, -1, "__close"); 167 lua_getfield(L, -1, "__close");
168 return (lua_tocfunction(L, -1))(L); 168 return (lua_tocfunction(L, -1))(L);
169} 169}
@@ -595,7 +595,7 @@ static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) {
595 lua_rawseti(L, 1, k); /* add it to common upvalue */ 595 lua_rawseti(L, 1, k); /* add it to common upvalue */
596 } 596 }
597 lua_pushvalue(L, 3); /* get environment for default files */ 597 lua_pushvalue(L, 3); /* get environment for default files */
598 lua_setenv(L, -2); /* set it as environment for file */ 598 lua_setuservalue(L, -2); /* set it as environment for file */
599 lua_setfield(L, 2, fname); /* add file to module */ 599 lua_setfield(L, 2, fname); /* add file to module */
600} 600}
601 601