From owner-freebsd-current@FreeBSD.ORG Mon Sep 10 11:18:50 2007 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D6D16A419 for ; Mon, 10 Sep 2007 11:18:50 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1E40B13C428 for ; Mon, 10 Sep 2007 11:18:49 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l8ABImk4069889; Mon, 10 Sep 2007 15:18:48 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1189423128; bh=q2vsktf13mVmHqJNUn0rZIx2oECWwe3HHbkTo8H bzN0=; l=595; h=Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:User-Agent; b=KwlziIoVXhwVNoldH/YrX5FMgrfv2RQOiQQEsROx K0d4J07HkZDFHObYgiGCQErgLLdDA9bEej4ObkKpl2EDvt17r+bQBe63UTEreyXpaTz 7HgyjKHqGPjrilIKYONU+xwqegzeRa8Vxsx+U4N49Lvsz70MNqs8r/BItRR+K76U= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l8ABIkQq069888; Mon, 10 Sep 2007 15:18:46 +0400 (MSD) (envelope-from ache) Date: Mon, 10 Sep 2007 15:18:45 +0400 From: Andrey Chernov To: "YAMAMOTO, Taku" , scf@FreeBSD.org Message-ID: <20070910111845.GA69818@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "YAMAMOTO, Taku" , scf@FreeBSD.org, freebsd-current@FreeBSD.ORG References: <20070910081425.3c45bca7.taku@tackymt.homeip.net> <20070910081736.45268f60.taku@tackymt.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070910081736.45268f60.taku@tackymt.homeip.net> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@FreeBSD.org Subject: Re: Follow-up: setenv() doesn't export unsetenv()ed variables to environ X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2007 11:18:50 -0000 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/