commit c676f13e1a7dd175f2a966c976e9f478dd69323b
parent 9b47cee8b218e274c89cb3481ca360a785936f48
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 5 Sep 2007 14:17:16 -0300
stand-alone error-message details
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lauxlib.c b/lauxlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.c,v 1.171 2007/06/22 15:39:34 roberto Exp roberto $
+** $Id: lauxlib.c,v 1.172 2007/08/10 12:56:02 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -99,7 +99,7 @@ static void pushfuncname (lua_State *L, lua_Debug *ar) {
else if (*ar->what == 'm') /* main? */
lua_pushfstring(L, "main chunk");
else if (*ar->what == 'C' || *ar->what == 't')
- lua_pushliteral(L, " ?"); /* C function or tail call */
+ lua_pushliteral(L, "?"); /* C function or tail call */
else
lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined);
}
diff --git a/lua.c b/lua.c
@@ -1,5 +1,5 @@
/*
-** $Id: lua.c,v 1.166 2007/06/22 15:33:54 roberto Exp roberto $
+** $Id: lua.c,v 1.167 2007/08/07 16:53:40 roberto Exp roberto $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
@@ -76,7 +76,7 @@ static int report (lua_State *L, int status) {
static int traceback (lua_State *L) {
const char *msg = lua_tostring(L, 1);
if (msg)
- luaL_traceback(L, L, msg, 2);
+ luaL_traceback(L, L, msg, 1);
else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */
if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */
lua_pushliteral(L, "(no error message)");
@@ -141,7 +141,7 @@ static int dostring (lua_State *L, const char *s, const char *name) {
static int dolibrary (lua_State *L, const char *name) {
lua_getglobal(L, "require");
lua_pushstring(L, name);
- return report(L, lua_pcall(L, 1, 0, 0));
+ return report(L, docall(L, 1, 1));
}