diff options
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.52 2002/05/15 18:57:44 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.53 2002/05/16 18:39:46 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -188,11 +188,10 @@ static int errorfb (lua_State *L) { | |||
188 | luaL_check_string(L, 1); | 188 | luaL_check_string(L, 1); |
189 | lua_settop(L, 1); | 189 | lua_settop(L, 1); |
190 | lua_pushliteral(L, "\n"); | 190 | lua_pushliteral(L, "\n"); |
191 | lua_pushliteral(L, "stack traceback:\n"); | ||
191 | while (lua_getstack(L, level++, &ar)) { | 192 | while (lua_getstack(L, level++, &ar)) { |
192 | char buff[10]; | 193 | char buff[10]; |
193 | if (level == 2) | 194 | if (level > LEVELS1 && firstpart) { |
194 | lua_pushliteral(L, "stack traceback:\n"); | ||
195 | else if (level > LEVELS1 && firstpart) { | ||
196 | /* no more than `LEVELS2' more levels? */ | 195 | /* no more than `LEVELS2' more levels? */ |
197 | if (!lua_getstack(L, level+LEVELS2, &ar)) | 196 | if (!lua_getstack(L, level+LEVELS2, &ar)) |
198 | level--; /* keep going */ | 197 | level--; /* keep going */ |