diff options
author | kyren <kerriganw@gmail.com> | 2018-07-18 05:29:27 -0400 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2018-07-18 05:29:27 -0400 |
commit | 73306d2286457ff50cc81727522ad82cb6b6c32a (patch) | |
tree | 4e4a6f072b00b2e9dbc5a282a25f476c57ed23d0 /lua/liolib.c | |
parent | 2d4f4b95c8f1504ae7751d56ed62db49a8170fda (diff) | |
download | mlua-73306d2286457ff50cc81727522ad82cb6b6c32a.zip |
Upgrade embedded Lua to 5.3.5
Diffstat (limited to 'lua/liolib.c')
-rw-r--r-- | lua/liolib.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lua/liolib.c b/lua/liolib.c index 1568403..8a9e75c 100644 --- a/lua/liolib.c +++ b/lua/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $ +** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) { } +static int f_close (lua_State *L) { + tofile(L); /* make sure argument is an open stream */ + return aux_close(L); +} + + static int io_close (lua_State *L) { if (lua_isnone(L, 1)) /* no argument? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ - tofile(L); /* make sure argument is an open stream */ - return aux_close(L); + return f_close(L); } @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = { ** methods for file handles */ static const luaL_Reg flib[] = { - {"close", io_close}, + {"close", f_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, |