summaryrefslogtreecommitdiff
path: root/libs/liblua/src/liolib.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2018-07-10 17:32:21 +0300
committerdartraiden <wowemuh@gmail.com>2018-07-10 17:35:53 +0300
commit98487dbc5b2650a1f17bd9454e4d0a6b966c033d (patch)
treea48684847b7f88ddc89eb65a24ddb1913d786bca /libs/liblua/src/liolib.c
parent6279b5f012a3b3d5734c9cc67c7a307cb0fd8eef (diff)
liblua: update to Lua 5.3.5
Diffstat (limited to 'libs/liblua/src/liolib.c')
-rw-r--r--libs/liblua/src/liolib.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/liblua/src/liolib.c b/libs/liblua/src/liolib.c
index 8491edca39..8a9e75cd08 100644
--- a/libs/liblua/src/liolib.c
+++ b/libs/liblua/src/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.150 2016/09/01 16:14:56 roberto Exp roberto $
+** $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},