Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Sep 2007 15:18:45 +0400
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        "YAMAMOTO, Taku" <taku@tackymt.homeip.net>, scf@FreeBSD.org
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: Follow-up: setenv() doesn't export unsetenv()ed variables to environ
Message-ID:  <20070910111845.GA69818@nagual.pp.ru>
In-Reply-To: <20070910081736.45268f60.taku@tackymt.homeip.net>
References:  <20070910081425.3c45bca7.taku@tackymt.homeip.net> <20070910081736.45268f60.taku@tackymt.homeip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 10, 2007 at 08:17:36AM +0900, YAMAMOTO, Taku wrote:
> > --- lib/libc/stdlib/getenv.c.orig	2007-07-21 08:30:13.000000000 +0900
> > +++ lib/libc/stdlib/getenv.c	2007-09-10 08:07:22.732672106 +0900
> > @@ -492,7 +492,7 @@ __setenv(const char *name, size_t nameLe
> >  	newEnvActive++;
> >  
> >  	/* No need to rebuild environ if the variable was reused. */
> > -	if (reuse)
> > +	if (reuse && newEnvActive == envActive)
> >  		return (0);
> >  	else
> >  		return (__rebuild_environ(newEnvActive));

Looks like the right fix.
CC'ed to author.

-- 
http://ache.pp.ru/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070910111845.GA69818>