aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-09-05 14:17:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-09-05 14:17:39 -0300
commitc676f13e1a7dd175f2a966c976e9f478dd69323b (patch)
tree6a5c6267076c6acb3bc154cadc903f7442c9db1d
parent9b47cee8b218e274c89cb3481ca360a785936f48 (diff)
downloadlua-c676f13e1a7dd175f2a966c976e9f478dd69323b.tar.gz
lua-c676f13e1a7dd175f2a966c976e9f478dd69323b.tar.bz2
lua-c676f13e1a7dd175f2a966c976e9f478dd69323b.zip
stand-alone error-message details
-rw-r--r--lauxlib.c4
-rw-r--r--lua.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 3bc6f088..1a3bf1a8 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.171 2007/06/22 15:39:34 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.172 2007/08/10 12:56:02 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -99,7 +99,7 @@ static void pushfuncname (lua_State *L, lua_Debug *ar) {
99 else if (*ar->what == 'm') /* main? */ 99 else if (*ar->what == 'm') /* main? */
100 lua_pushfstring(L, "main chunk"); 100 lua_pushfstring(L, "main chunk");
101 else if (*ar->what == 'C' || *ar->what == 't') 101 else if (*ar->what == 'C' || *ar->what == 't')
102 lua_pushliteral(L, " ?"); /* C function or tail call */ 102 lua_pushliteral(L, "?"); /* C function or tail call */
103 else 103 else
104 lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); 104 lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined);
105} 105}
diff --git a/lua.c b/lua.c
index 289ae87f..dec5612d 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.166 2007/06/22 15:33:54 roberto Exp roberto $ 2** $Id: lua.c,v 1.167 2007/08/07 16:53:40 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -76,7 +76,7 @@ static int report (lua_State *L, int status) {
76static int traceback (lua_State *L) { 76static int traceback (lua_State *L) {
77 const char *msg = lua_tostring(L, 1); 77 const char *msg = lua_tostring(L, 1);
78 if (msg) 78 if (msg)
79 luaL_traceback(L, L, msg, 2); 79 luaL_traceback(L, L, msg, 1);
80 else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */ 80 else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */
81 if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ 81 if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */
82 lua_pushliteral(L, "(no error message)"); 82 lua_pushliteral(L, "(no error message)");
@@ -141,7 +141,7 @@ static int dostring (lua_State *L, const char *s, const char *name) {
141static int dolibrary (lua_State *L, const char *name) { 141static int dolibrary (lua_State *L, const char *name) {
142 lua_getglobal(L, "require"); 142 lua_getglobal(L, "require");
143 lua_pushstring(L, name); 143 lua_pushstring(L, name);
144 return report(L, lua_pcall(L, 1, 0, 0)); 144 return report(L, docall(L, 1, 1));
145} 145}
146 146
147 147