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 /iolib.c | |
parent | c9e6ed1d9fdf3323599a59515e73ec794b7cb15a (diff) | |
download | lua-20a48a818f4084f1b6480e3ec846c219abaafd5b.tar.gz lua-20a48a818f4084f1b6480e3ec846c219abaafd5b.tar.bz2 lua-20a48a818f4084f1b6480e3ec846c219abaafd5b.zip |
a file handle must be a userdata.
Diffstat (limited to 'iolib.c')
-rw-r--r-- | iolib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -41,7 +41,7 @@ static void pushresult (int i) | |||
41 | static FILE *getfile (char *name) | 41 | static FILE *getfile (char *name) |
42 | { | 42 | { |
43 | lua_Object f = lua_getglobal(name); | 43 | lua_Object f = lua_getglobal(name); |
44 | if (lua_tag(f) != lua_tagio) | 44 | if (!lua_isuserdata(f) || lua_tag(f) != lua_tagio) |
45 | luaL_verror("global variable %s is not a file handle", name); | 45 | luaL_verror("global variable %s is not a file handle", name); |
46 | return lua_getuserdata(f); | 46 | return lua_getuserdata(f); |
47 | } | 47 | } |