diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-05 04:41:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-05 04:41:21 +0000 |
commit | 76f0202393a0afee6515cdc7d86dfdd80a8ab5c5 (patch) | |
tree | 638cf572ae7f4776965610fd0e2b3765cb228937 /hash.c | |
parent | 7ada9b8b5aa450ea8141686784d72e91caea719f (diff) |
20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -688,10 +688,9 @@ rb_hash_inspect(hash) } static VALUE -hash_to_s(hash) +to_s_hash(hash) VALUE hash; { - if (rb_inspecting_p(hash)) return rb_str_new2("{...}"); return rb_ary_to_s(rb_hash_to_a(hash)); } @@ -699,8 +698,10 @@ static VALUE rb_hash_to_s(hash) VALUE hash; { + VALUE str; + if (rb_inspecting_p(hash)) return rb_str_new2("{...}"); - return rb_protect_inspect(hash_to_s, hash, 0); + return rb_protect_inspect(to_s_hash, hash, 0); } static VALUE @@ -1366,7 +1367,7 @@ env_index(dmy, value) char *s = strchr(*env, '=')+1; if (s) { if (strncmp(s, RSTRING(value)->ptr, strlen(s)) == 0) { - return rb_tainted_str_new(*env, s-*env); + return rb_tainted_str_new(*env, s-*env-1); } } env++; |