aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-14 04:27:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-14 04:27:39 +0000
commit5d581bc314e2017c8357c7dfd88ea6f69a29afaf (patch)
tree73b23558922babbfa5dc630fbb3935bfcd8a0cc9 /lib/pp.rb
parent8f1e1664991d9197b30ee1eb18eeabcebb37a392 (diff)
downloadruby-5d581bc314e2017c8357c7dfd88ea6f69a29afaf.tar.gz
* lib/pp.rb (PP#object_address_group): remove odd number of 'f'
prefixed to negative address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pp.rb')
-rw-r--r--lib/pp.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index 6ddd4dd2eb..756dce6f51 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -219,7 +219,9 @@ class PP < PrettyPrint
end
def object_address_group(obj, &block)
- group(1, "\#<#{obj.class}:#{("0x%x" % (obj.__id__ * 2)).sub(/\.\.f/, '')}", '>', &block)
+ id = "%x" % (obj.__id__ * 2)
+ id.sub!(/\Af(?=[[:xdigit:]]{2}+\z)/, '') if id.sub!(/\A\.\./, '')
+ group(1, "\#<#{obj.class}:0x#{id}", '>', &block)
end
def comma_breakable