'lua_load' has an extra argument 'mode'

This commit is contained in:
Roberto Ierusalimschy
2011-11-29 13:55:08 -02:00
parent 8c62bde36f
commit 3617e04e97
7 changed files with 50 additions and 75 deletions

6
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.156 2011/10/31 17:48:51 roberto Exp roberto $
** $Id: lapi.c,v 2.157 2011/11/16 18:51:36 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -968,13 +968,13 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
const char *chunkname) {
const char *chunkname, const char *mode) {
ZIO z;
int status;
lua_lock(L);
if (!chunkname) chunkname = "?";
luaZ_init(L, &z, reader, data);
status = luaD_protectedparser(L, &z, chunkname);
status = luaD_protectedparser(L, &z, chunkname, mode);
if (status == LUA_OK) { /* no errors? */
LClosure *f = clLvalue(L->top - 1); /* get newly created function */
if (f->nupvalues == 1) { /* does it have one upvalue? */