diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -811,9 +811,9 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, | |||
811 | } | 811 | } |
812 | if (c != EOF) | 812 | if (c != EOF) |
813 | lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ | 813 | lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ |
814 | errno = 0; | ||
814 | status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); | 815 | status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); |
815 | readstatus = ferror(lf.f); | 816 | readstatus = ferror(lf.f); |
816 | errno = 0; /* no useful error number until here */ | ||
817 | if (filename) fclose(lf.f); /* close file (even in case of errors) */ | 817 | if (filename) fclose(lf.f); /* close file (even in case of errors) */ |
818 | if (readstatus) { | 818 | if (readstatus) { |
819 | lua_settop(L, fnameindex); /* ignore results from 'lua_load' */ | 819 | lua_settop(L, fnameindex); /* ignore results from 'lua_load' */ |