Fix bytecode loading on Windows.

This commit is contained in:
Mike Pall 2011-06-14 12:47:48 +02:00
parent ecab831ebf
commit 9cf2cd2a11

View File

@ -255,7 +255,7 @@ LUALIB_API int luaL_loadfile(lua_State *L, const char *filename)
int status; int status;
const char *chunkname; const char *chunkname;
if (filename) { if (filename) {
ctx.fp = fopen(filename, "r"); ctx.fp = fopen(filename, "rb");
if (ctx.fp == NULL) { if (ctx.fp == NULL) {
lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno)); lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno));
return LUA_ERRFILE; return LUA_ERRFILE;