From e791f025c0c59b0a428fab604a7e2251cca568f5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 Jan 2005 14:30:59 -0200 Subject: no more `_TRACEBACK' variable --- lua.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lua.c') diff --git a/lua.c b/lua.c index 5e4ca9fb..e316e9c4 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.132 2004/08/30 18:35:14 roberto Exp roberto $ +** $Id: lua.c,v 1.133 2004/11/18 19:53:49 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -82,8 +82,7 @@ static int report (lua_State *L, int status) { static int docall (lua_State *L, int narg, int clear) { int status; int base = lua_gettop(L) - narg; /* function index */ - lua_pushliteral(L, "_TRACEBACK"); - lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ + luaL_getfield(L, LUA_GLOBALSINDEX, "debug.traceback"); lua_insert(L, base); /* put it under chunk and args */ signal(SIGINT, laction); status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); @@ -359,7 +358,7 @@ static int pmain (lua_State *L) { int interactive = 1; if (s->argv[0] && s->argv[0][0]) progname = s->argv[0]; globalL = L; - lua_userinit(L); /* open libraries */ + luaopen_stdlibs(L); /* open libraries */ status = handle_luainit(L); if (status == 0) { status = handle_argv(L, s->argv, &interactive); -- cgit v1.2.3-55-g6feb