diff options
-rw-r--r-- | Build/source/texk/web2c/luatexdir/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/liolibext.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index efbe06d3135..f41902ae1eb 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,7 @@ +2013-12-19 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * lua/liolibext.c: Large files in lua. + 2013-12-12 Peter Breitenlohner <peb@mppmu.mpg.de> * image/epdf.h, lua/lepdflib.cc: Adapt for poppler-0.25.x. diff --git a/Build/source/texk/web2c/luatexdir/lua/liolibext.c b/Build/source/texk/web2c/luatexdir/lua/liolibext.c index e2c7c330b50..48380632c72 100644 --- a/Build/source/texk/web2c/luatexdir/lua/liolibext.c +++ b/Build/source/texk/web2c/luatexdir/lua/liolibext.c @@ -405,16 +405,16 @@ static int read_line(lua_State * L, FILE * f, int chop) static void read_all (lua_State *L, FILE *f) { size_t rlen = LUAL_BUFFERSIZE; /* how much to read in each cycle */ - size_t old, nrlen = 0; /* for testing file size */ + l_seeknum old, nrlen = 0; /* for testing file size */ luaL_Buffer b; luaL_buffinit(L, &b); /* speed up loading of not too large files: */ - old = ftell(f); - if ((fseek(f, 0, SEEK_END) >= 0) && - ((nrlen = ftell(f)) > 0) && nrlen < 1000 * 1000 * 100) { + old = l_ftell(f); + if ((l_fseek(f, 0, SEEK_END) >= 0) && + ((nrlen = l_ftell(f)) > 0) && nrlen < 1000 * 1000 * 100) { rlen = nrlen; } - fseek(f, old, SEEK_SET); + l_fseek(f, old, SEEK_SET); for (;;) { char *p = luaL_prepbuffsize(&b, rlen); size_t nr = fread(p, sizeof(char), rlen, f); |