ruby-changes:40829
From: nobu <ko1@a...>
Date: Sun, 6 Dec 2015 21:13:41 +0900 (JST)
Subject: [ruby-changes:40829] nobu:r52908 (trunk): hash.c: fix rubyspec failure
nobu 2015-12-06 21:13:25 +0900 (Sun, 06 Dec 2015) New Revision: 52908 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52908 Log: hash.c: fix rubyspec failure * hash.c (env_fetch): yield coerced string. * hash.c (env_assoc): return coerced string. Modified files: trunk/hash.c Index: hash.c =================================================================== --- hash.c (revision 52907) +++ hash.c (revision 52908) @@ -3043,7 +3043,7 @@ rb_f_getenv(VALUE obj, VALUE name) https://github.com/ruby/ruby/blob/trunk/hash.c#L3043 static VALUE env_fetch(int argc, VALUE *argv) { - VALUE key, name; + VALUE key; long block_given; const char *nam, *env; @@ -3053,8 +3053,7 @@ env_fetch(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/hash.c#L3053 if (block_given && argc == 2) { rb_warn("block supersedes default value argument"); } - name = key; - nam = env_name(name); + nam = env_name(key); env = getenv(nam); if (!env) { if (block_given) return rb_yield(key); @@ -3842,9 +3841,8 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/hash.c#L3841 env_assoc(VALUE env, VALUE key) { const char *s, *e; - VALUE name = key; - s = env_name(name); + s = env_name(key); e = getenv(s); if (e) return rb_assoc_new(key, rb_tainted_str_new2(e)); return Qnil; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/