From 39fb2a27abbb585fa27e87720025c297b081acb7 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 12 Jun 2001 05:31:47 +0000 Subject: * eval.c (method_eq): new method Method#==. [new] * gc.c (STR_NO_ORIG): STR_NO_ORIG value was different between string.c and gc.c * eval.c (rb_eval): should convert *non-array at the end of arguments by using Array(). * hash.c (ruby_setenv): readline library leaves their environment strings uncopied. "free" check revised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1523 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 f3c621acee..39a9a522d7 100644 --- a/hash.c +++ b/hash.c @@ -1066,8 +1066,12 @@ ruby_setenv(name, value) environ = tmpenv; /* tell exec where it is now */ } if (!value) { - if (environ[i] != origenviron[i]) - free(environ[i]); + if (environ != origenviron) { + char **envp = origenviron; + while (*envp && *envp != environ[i]) envp++; + if (!*envp) + free(environ[i]); + } while (environ[i]) { environ[i] = environ[i+1]; i++; -- cgit v1.2.3