From 88abd791f522c7097141753c3480a456340215f8 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 29 Oct 2001 05:07:26 +0000 Subject: * parse.y (str_extend): shuould allow interpolation of $-x. * variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop. * variable.c (rb_cvar_get): ditto. * variable.c (cvar_override_check): ditto. * bignum.c (rb_big_eq): convert Bignum to Float, instead of reverse. * time.c (time_localtime): getting tm should not be prohibited for frozen time objects. * time.c (time_gmtime): ditto. * version.c (Init_version): freeze RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. * file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and PATH_SEPARATOR. * file.c (rb_stat_cmp): should check operand type before calling get_stat(). * eval.c (rb_eval_cmd): should not invoke "call" with a block on any occasion. * numeric.c (fix_aref): idx may be a Bignum. * numeric.c (num_remainder): a bug in Numeric#remainder. * eval.c (rb_exec_end_proc): END might be called within END block. * class.c (rb_mod_clone): should not copy class name, since clone should remain anonymous. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 2f9511a8c9..7eb519b8b2 100644 --- a/hash.c +++ b/hash.c @@ -1098,7 +1098,7 @@ ruby_unsetenv(name) } static VALUE -rb_f_setenv(obj, nm, val) +env_aset(obj, nm, val) VALUE obj, nm, val; { char *name, *value; @@ -1126,13 +1126,13 @@ rb_f_setenv(obj, nm, val) if (OBJ_TAINTED(val)) { /* already tainted, no check */ path_tainted = 1; - return Qtrue; + return val; } else { path_tainted_p(value); } } - return Qtrue; + return val; } static VALUE @@ -1499,8 +1499,8 @@ Init_Hash() rb_define_singleton_method(envtbl,"[]", rb_f_getenv, 1); rb_define_singleton_method(envtbl,"fetch", env_fetch, -1); - rb_define_singleton_method(envtbl,"[]=", rb_f_setenv, 2); - rb_define_singleton_method(envtbl,"store", rb_f_setenv, 2); + rb_define_singleton_method(envtbl,"[]=", env_aset, 2); + rb_define_singleton_method(envtbl,"store", env_aset, 2); rb_define_singleton_method(envtbl,"each", env_each, 0); rb_define_singleton_method(envtbl,"each_pair", env_each, 0); rb_define_singleton_method(envtbl,"each_key", env_each_key, 0); -- cgit v1.2.3