From e57215bf51b99836a766f497a405760e8026d2ec Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 12 Jan 2011 15:35:07 +0000 Subject: [PATCH] * addr2line.c (get_nth_dirname): decrement the directory index because the index specifies the index of given included_directories which is separated by NUL and its index is begun from 1. Note that 0 specifies the current directory of the compilation. see also http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ addr2line.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 42bb121fd2..ec8b0cc105 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Jan 13 00:32:54 2011 NARUSE, Yui + + * addr2line.c (get_nth_dirname): decrement the directory index + because the index specifies the index of given included_directories + which is separated by NUL and its index is begun from 1. + Note that 0 specifies the current directory of the compilation. + see also http://www.dwarfstd.org/doc/dwarf-2.0.0.pdf + Thu Jan 13 00:06:38 2011 KOSAKI Motohiro * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062] diff --git a/addr2line.c b/addr2line.c index 605c6f60d3..91b4be99ab 100644 --- a/addr2line.c +++ b/addr2line.c @@ -121,7 +121,7 @@ get_nth_dirname(int dir, char *p) if (!dir--) { return ""; } - while (dir) { + while (dir--) { while (*p) p++; p++; if (!*p) {