diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-27 19:38:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-06-27 19:38:49 -0300 |
commit | 20a48a818f4084f1b6480e3ec846c219abaafd5b (patch) | |
tree | 77e909df286196927a60d2eeff4e21b41870ed7c | |
parent | c9e6ed1d9fdf3323599a59515e73ec794b7cb15a (diff) | |
download | lua-github-20a48a818f4084f1b6480e3ec846c219abaafd5b.tar.gz |
a file handle must be a userdata.
-rw-r--r-- | iolib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |