a file handle must be a userdata.
This commit is contained in:
1 parent
c9e6ed1d9f
commit
20a48a818f
1 file changed
+1
-1
@@ -41,7 +41,7 @@ static void pushresult (int i)
|
|||||||
static FILE *getfile (char *name)
|
static FILE *getfile (char *name)
|
||||||
{
|
{
|
||||||
lua_Object f = lua_getglobal(name);
|
lua_Object f = lua_getglobal(name);
|
||||||
if (lua_tag(f) != lua_tagio)
|
if (!lua_isuserdata(f) || lua_tag(f) != lua_tagio)
|
||||||
luaL_verror("global variable %s is not a file handle", name);
|
luaL_verror("global variable %s is not a file handle", name);
|
||||||
return lua_getuserdata(f);
|
return lua_getuserdata(f);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user