From owner-svn-src-head@FreeBSD.ORG Tue Dec 1 10:06:06 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 924311065670; Tue, 1 Dec 2009 10:06:06 +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 039688FC12; Tue, 1 Dec 2009 10:06:05 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id nB1A646x078275; Tue, 1 Dec 2009 13:06:04 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1259661964; bh=oPCWw2UKGV+LahIkYmaE+IdqrKgNMIFcMsjP0vdTcMc=; l=656; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=tYb4zvlNdFbjyO6CCMiXFZwB8NWYjUwIZgjJO/XIpFQDzGrDxUT7EFtfA//WgI7Yy +ahREP2ivvSO4nLpjA7Rc6Ss1rVCV/cFB9E8ZMETc0TKnmFqb8Z2JtwSj5ElCB8Dc/ mpDGxwVd75UqPOCVDSW90WJxu48oden80oeIfCg0= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id nB1A63or078274; Tue, 1 Dec 2009 13:06:04 +0300 (MSK) (envelope-from ache) Date: Tue, 1 Dec 2009 13:06:03 +0300 From: Andrey Chernov To: Brian Feldman Message-ID: <20091201100602.GA77706@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Brian Feldman , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <200912010504.nB154VnS053167@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 10:06:06 -0000 On Tue, Dec 01, 2009 at 05:04:31AM +0000, Brian Feldman wrote: > - if (environ == NULL || environ[0] == NULL) > - return (NULL); > - else if (envVars == NULL || environ != intEnviron) > + if (envVars == NULL) > return (__findenv_environ(name, nameLen)); > - else { > - envNdx = envVarsTotal - 1; > - return (__findenv(name, nameLen, &envNdx, true)); > - } > + > + /* Synchronize environment. */ > + if (__merge_environ() == -1) > + return (NULL); > + > + envNdx = envVarsTotal - 1; > + return (__findenv(name, nameLen, &envNdx, true)); > } __merge_environ() should be avoided here for speed reasons. -- http://ache.pp.ru/