mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-26 20:02:30 +01:00
13 lines
401 B
Diff
13 lines
401 B
Diff
--- a/liolib-copy.c
|
|
+++ b/liolib-copy.c
|
|
@@ -312,8 +312,7 @@ static int io_fclose(lua_State *L)
|
|
FILE *liolib_copy_tofile(lua_State *L, int index)
|
|
{
|
|
int eq;
|
|
- if (lua_type(L, index) != LUA_TTABLE) return NULL;
|
|
- lua_getmetatable(L, index);
|
|
+ if (0 == lua_getmetatable(L, index)) return NULL;
|
|
luaL_getmetatable(L, LUA_FILEHANDLE);
|
|
eq = lua_equal(L, -2, -1);
|
|
lua_pop(L, 2);
|