diff options
-rw-r--r-- | ldo.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.168 2002/03/26 20:46:10 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.169 2002/04/10 12:10:54 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -447,6 +447,7 @@ LUA_API int lua_loadfile (lua_State *L, const char *filename) { | |||
447 | filename = lua_tostring(L, -1); /* filename = `@'..filename */ | 447 | filename = lua_tostring(L, -1); /* filename = `@'..filename */ |
448 | luaZ_Fopen(&z, f, filename); | 448 | luaZ_Fopen(&z, f, filename); |
449 | status = protectedparser(L, &z, bin); | 449 | status = protectedparser(L, &z, bin); |
450 | if (ferror(f)) status = LUA_ERRFILE; | ||
450 | lua_remove(L, nlevel); /* remove filename */ | 451 | lua_remove(L, nlevel); /* remove filename */ |
451 | if (f != stdin) | 452 | if (f != stdin) |
452 | fclose(f); | 453 | fclose(f); |