lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 885961be1d8e3f703b54d1d19e6c63617cd2ed24
parent b1141427991dea7a96597f2aacdedf243b60decd
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 27 Aug 2003 17:57:30 -0300

reader runs outside core Lua

Diffstat:
Mlzio.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lzio.c b/lzio.c @@ -1,5 +1,5 @@ /* -** $Id: lzio.c,v 1.25 2003/08/25 19:51:54 roberto Exp roberto $ +** $Id: lzio.c,v 1.26 2003/08/25 20:00:50 roberto Exp roberto $ ** a generic input stream interface ** See Copyright Notice in lua.h */ @@ -13,12 +13,17 @@ #include "llimits.h" #include "lmem.h" +#include "lstate.h" #include "lzio.h" int luaZ_fill (ZIO *z) { size_t size; - const char *buff = z->reader(z->L, z->data, &size); + lua_State *L = z->L; + const char *buff; + lua_unlock(L); + buff = z->reader(L, z->data, &size); + lua_lock(L); if (buff == NULL || size == 0) return EOZ; z->n = size - 1; z->p = buff;