mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
dbb6c39f7c
10
src/lib_io.c
10
src/lib_io.c
@ -284,8 +284,14 @@ static int io_file_lines(lua_State *L)
|
|||||||
|
|
||||||
LJLIB_CF(io_method_close)
|
LJLIB_CF(io_method_close)
|
||||||
{
|
{
|
||||||
IOFileUD *iof = L->base < L->top ? io_tofile(L) :
|
IOFileUD *iof;
|
||||||
io_stdfile(L, GCROOT_IO_OUTPUT);
|
if (L->base < L->top) {
|
||||||
|
iof = io_tofile(L);
|
||||||
|
} else {
|
||||||
|
iof = IOSTDF_IOF(L, GCROOT_IO_OUTPUT);
|
||||||
|
if (iof->fp == NULL)
|
||||||
|
lj_err_caller(L, LJ_ERR_IOCLFL);
|
||||||
|
}
|
||||||
return io_file_close(L, iof);
|
return io_file_close(L, iof);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user