From a3f29338ad53c1027eeef0d3c7168d3355105d20 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 1 Dec 1999 09:24:48 +0000 Subject: 19991201 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 8fb2153f84..10e9f86346 100644 --- a/hash.c +++ b/hash.c @@ -689,8 +689,12 @@ static VALUE hash_to_s(hash) VALUE hash; { + VALUE str; + if (rb_inspecting_p(hash)) return rb_str_new2("{...}"); - return rb_ary_to_s(rb_hash_to_a(hash)); + str = rb_ary_to_s(rb_hash_to_a(hash)); + if (OBJ_TAINTED(hash)) OBJ_TAINT(str); + return hash; } static VALUE @@ -798,7 +802,7 @@ equal_i(key, val1, data) { VALUE val2; - if (val1 == Qnil) return ST_CONTINUE; + if (key == Qnil) return ST_CONTINUE; if (!st_lookup(data->tbl, key, &val2)) { data->result = Qfalse; return ST_STOP; -- cgit v1.2.3