소스 검색

a file handle must be a userdata.

Roberto Ierusalimschy 28 년 전
부모
커밋
20a48a818f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      iolib.c

+ 1 - 1
iolib.c

@@ -41,7 +41,7 @@ static void pushresult (int i)
 static FILE *getfile (char *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);
   return lua_getuserdata(f);
 }