Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2009 13:06:03 +0300
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Brian Feldman <green@FreeBSD.org>
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
Message-ID:  <20091201100602.GA77706@nagual.pp.ru>
In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org>
References:  <200912010504.nB154VnS053167@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



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