aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-25 23:16:37 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-25 23:16:37 +0100
commit451a2148c933454059be4e606efc35883b3803ad (patch)
tree17034800e531b751dbadf8fe8dd2315308c5f5f7 /util
parent7a7b03129d175b7742ce432b834c6430ba908b5b (diff)
downloadprosody-451a2148c933454059be4e606efc35883b3803ad.tar.gz
prosody-451a2148c933454059be4e606efc35883b3803ad.zip
util.debug: Some more magic constant fiddling. Don't ask me.
Diffstat (limited to 'util')
-rw-r--r--util/debug.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/debug.lua b/util/debug.lua
index 7caf21ce..16773cd1 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -88,9 +88,9 @@ function get_traceback_table(thread, start_level)
for level = start_level, math.huge do
local info;
if thread then
- info = debug.getinfo(thread, level);
+ info = debug.getinfo(thread, level+1);
else
- info = debug.getinfo(level);
+ info = debug.getinfo(level+1);
end
if not info then break; end
@@ -128,13 +128,13 @@ function _traceback(thread, message, level)
if type(message) == "number" then
level, message = message, nil;
else
- level = 2;
+ level = 1;
end
end
message = message and (message.."\n") or "";
- local levels = get_traceback_table(thread, level+2);
+ local levels = get_traceback_table(thread, level+3);
local last_source_desc;