summaryrefslogtreecommitdiffstats
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
commitab9eccd1ac338a5a22875322fd50e23f1f85c00f (patch)
tree73b23558922babbfa5dc630fbb3935bfcd8a0cc9
parentbd3977e8fcb0dea08742f8debd7a0b2bace1e829 (diff)
downloadruby-ab9eccd1ac338a5a22875322fd50e23f1f85c00f.tar.gz
ruby-ab9eccd1ac338a5a22875322fd50e23f1f85c00f.tar.xz
ruby-ab9eccd1ac338a5a22875322fd50e23f1f85c00f.zip
* lib/pp.rb (PP#object_address_group): remove odd number of 'f'
prefixed to negative address. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/pp.rb4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 11c0894f5..334a1db6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov 14 13:27:03 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/pp.rb (PP#object_address_group): remove odd number of 'f'
+ prefixed to negative address.
+
Sun Nov 14 08:46:33 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* test/logger/test_logger.rb: Logger just expects
diff --git a/lib/pp.rb b/lib/pp.rb
index 6ddd4dd2e..756dce6f5 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