diff options
Diffstat (limited to 'liolib.c')
| -rw-r--r-- | liolib.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.63 2005/06/06 18:42:21 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.64 2005/07/12 14:32:08 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 | */ |
| @@ -493,7 +493,7 @@ static void createmeta (lua_State *L) { | |||
| 493 | luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ | 493 | luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ |
| 494 | lua_pushvalue(L, -1); /* push metatable */ | 494 | lua_pushvalue(L, -1); /* push metatable */ |
| 495 | lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ | 495 | lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ |
| 496 | luaL_openlib(L, NULL, flib, 0); /* file methods */ | 496 | luaL_register(L, NULL, flib); /* file methods */ |
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | 499 | ||
| @@ -513,7 +513,7 @@ LUALIB_API int luaopen_io (lua_State *L) { | |||
| 513 | lua_newtable(L); | 513 | lua_newtable(L); |
| 514 | lua_replace(L, LUA_ENVIRONINDEX); | 514 | lua_replace(L, LUA_ENVIRONINDEX); |
| 515 | /* open library */ | 515 | /* open library */ |
| 516 | luaL_openlib(L, LUA_IOLIBNAME, iolib, 0); | 516 | luaL_register(L, LUA_IOLIBNAME, iolib); |
| 517 | /* create (and set) default files */ | 517 | /* create (and set) default files */ |
| 518 | createstdfile(L, stdin, IO_INPUT, "stdin"); | 518 | createstdfile(L, stdin, IO_INPUT, "stdin"); |
| 519 | createstdfile(L, stdout, IO_OUTPUT, "stdout"); | 519 | createstdfile(L, stdout, IO_OUTPUT, "stdout"); |
