[syslinux] [PATCH 13/21] lua: the COM32 API does not support freopen()
Ferenc Wágner
wferi at niif.hu
Tue Oct 15 11:03:41 PDT 2013
Nor the concept of text vs. binary open mode, so it does not matter.
---
com32/lua/src/lauxlib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/com32/lua/src/lauxlib.c b/com32/lua/src/lauxlib.c
index 2e989d6..07a9316 100644
--- a/com32/lua/src/lauxlib.c
+++ b/com32/lua/src/lauxlib.c
@@ -644,11 +644,13 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
}
if (skipcomment(&lf, &c)) /* read initial portion */
lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */
+#ifndef SYSLINUX
if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */
lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */
if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
skipcomment(&lf, &c); /* re-read initial portion */
}
+#endif
if (c != EOF)
lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
--
1.7.10.4
More information about the Syslinux
mailing list