From 8db3dc39d60870e07cbdfec5e594e0f49b0733c7 Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 12 Jun 2005 16:56:06 +0000 Subject: * signal.c (sigexit): call rb_thread_signal_exit() instead of rb_exit(). [ruby-dev:26347] * eval.c (rb_thread_signal_exit): a new function to exit on main thread. * eval.c (rb_thread_switch): exit status should be retrieved from ruby_errinfo. * eval.c (rb_f_exit): ensure exit(0) should call exit(EXIT_SUCCESS). * missing/mkdir.c: remove. [ruby-core:05177] * hash.c (env_aset): do not treat nil as key-removing value. [ruby-list:40865] * parse.y (method_call): allow aref expression ([]) to take a block. * parse.y (block_dup_check): a function to check duplication of a block argument and an actual block. * lib/delegate.rb (SimpleDelegator::__setobj__): need check for recursive delegation. [ruby-core:04940] * lib/cgi.rb: add underscore aliases CGI::escape_html, CGI::unescape_html, CGI::escape_element, CGI::unescape_element. [ruby-core:05058] * misc/ruby-mode.el (ruby-expr-beg): fix looking point drift. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index d0c95720a8..88b060f11a 100644 --- a/hash.c +++ b/hash.c @@ -1826,17 +1826,17 @@ ruby_setenv(name, value) } if (!value) { if (environ != origenviron) { - char **envp = origenviron; - while (*envp && *envp != environ[i]) envp++; - if (!*envp) - free(environ[i]); + char **envp = origenviron; + while (*envp && *envp != environ[i]) envp++; + if (!*envp) + free(environ[i]); } - while (environ[i]) { - environ[i] = environ[i+1]; - i++; + while (environ[i]) { + environ[i] = environ[i+1]; + i++; + } + return; } - return; - } if (!environ[i]) { /* does not exist yet */ REALLOC_N(environ, char*, i+2); /* just expand it a bit */ environ[i+1] = 0; /* make sure it's null terminated */ @@ -1878,11 +1878,6 @@ env_aset(obj, nm, val) rb_raise(rb_eSecurityError, "can't change environment variable"); } - if (NIL_P(val)) { - env_delete(obj, nm); - return Qnil; - } - StringValue(nm); StringValue(val); name = RSTRING(nm)->ptr; -- cgit v1.2.3