diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-09-05 14:17:39 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-09-05 14:17:39 -0300 |
commit | c676f13e1a7dd175f2a966c976e9f478dd69323b (patch) | |
tree | 6a5c6267076c6acb3bc154cadc903f7442c9db1d | |
parent | 9b47cee8b218e274c89cb3481ca360a785936f48 (diff) | |
download | lua-c676f13e1a7dd175f2a966c976e9f478dd69323b.tar.gz lua-c676f13e1a7dd175f2a966c976e9f478dd69323b.tar.bz2 lua-c676f13e1a7dd175f2a966c976e9f478dd69323b.zip |
stand-alone error-message details
-rw-r--r-- | lauxlib.c | 4 | ||||
-rw-r--r-- | lua.c | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -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 | } |
@@ -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) { | |||
76 | static int traceback (lua_State *L) { | 76 | static 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) { | |||
141 | static int dolibrary (lua_State *L, const char *name) { | 141 | static 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 | ||