Re: Follow-up: setenv() doesn't export unsetenv()ed variables to environ

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Mon, 10 Sep 2007 15:18:45 +0400
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
> > _at__at_ -492,7 +492,7 _at__at_ __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/
Received on Mon Sep 10 2007 - 09:18:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC