summaryrefslogtreecommitdiff
path: root/liolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-10 16:05:36 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-10 16:05:36 -0200
commitc97aa9485caf253eceebc00cf08cfa8b179fe35e (patch)
treeb54254b30e4354f4fdad5264cfd4e7baa9e40ab5 /liolib.c
parente885b91326986f1b5a341e9ff1444c4f46c6241a (diff)
downloadlua-c97aa9485caf253eceebc00cf08cfa8b179fe35e.tar.gz
lua-c97aa9485caf253eceebc00cf08cfa8b179fe35e.tar.bz2
lua-c97aa9485caf253eceebc00cf08cfa8b179fe35e.zip
new function 'luaL_setmetatable'
Diffstat (limited to 'liolib.c')
-rw-r--r--liolib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/liolib.c b/liolib.c
index 6786201a..4b15fd35 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.93 2010/11/08 17:27:22 roberto Exp roberto $ 2** $Id: liolib.c,v 2.94 2010/11/09 16:57:49 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*/
@@ -114,8 +114,7 @@ static FILE *tofile (lua_State *L) {
114static FILE **newprefile (lua_State *L) { 114static FILE **newprefile (lua_State *L) {
115 FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); 115 FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *));
116 *pf = NULL; /* file handle is currently `closed' */ 116 *pf = NULL; /* file handle is currently `closed' */
117 luaL_getmetatable(L, LUA_FILEHANDLE); 117 luaL_setmetatable(L, LUA_FILEHANDLE);
118 lua_setmetatable(L, -2);
119 return pf; 118 return pf;
120} 119}
121 120