aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-27 18:01:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-27 18:01:44 -0300
commit8332d5c8a5059b85da1adaa3f0197d0f57afae81 (patch)
tree8a2f59ff0803da3afbc7e8a409911c920d624e94 /lapi.c
parent885961be1d8e3f703b54d1d19e6c63617cd2ed24 (diff)
downloadlua-8332d5c8a5059b85da1adaa3f0197d0f57afae81.tar.gz
lua-8332d5c8a5059b85da1adaa3f0197d0f57afae81.tar.bz2
lua-8332d5c8a5059b85da1adaa3f0197d0f57afae81.zip
parser fully reentrant(!)
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lapi.c b/lapi.c
index 966f72ec..33eed2eb 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.242 2003/08/25 19:51:54 roberto Exp roberto $ 2** $Id: lapi.c,v 1.243 2003/08/25 20:00:50 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -715,12 +715,10 @@ LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *data,
715 const char *chunkname) { 715 const char *chunkname) {
716 ZIO z; 716 ZIO z;
717 int status; 717 int status;
718 int c;
719 lua_lock(L); 718 lua_lock(L);
720 if (!chunkname) chunkname = "?"; 719 if (!chunkname) chunkname = "?";
721 luaZ_init(L, &z, reader, data); 720 luaZ_init(L, &z, reader, data);
722 c = luaZ_lookahead(&z); 721 status = luaD_protectedparser(L, &z, chunkname);
723 status = luaD_protectedparser(L, &z, (c == LUA_SIGNATURE[0]), chunkname);
724 lua_unlock(L); 722 lua_unlock(L);
725 return status; 723 return status;
726} 724}