Date: Mon, 30 Apr 2007 20:36:24 +0200 From: Henrik Brix Andersen <henrik@brixandersen.dk> To: "Andrey A. Chernov" <ache@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/stdlib getenv.3 getenv.c putenv.c setenv.c Message-ID: <20070430183624.GA73050@tirith.brixandersen.dk> In-Reply-To: <200704301656.l3UGuIqf048148@repoman.freebsd.org> References: <200704301656.l3UGuIqf048148@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi, On Mon, Apr 30, 2007 at 04:56:18PM +0000, Andrey A. Chernov wrote: > ache 2007-04-30 16:56:18 UTC > > FreeBSD src repository > > Modified files: > lib/libc/stdlib getenv.3 getenv.c putenv.c setenv.c > Log: > Make putenv() fully conforms to Open Group specs Issue 6 > (also IEEE Std 1003.1-2001) > > The specs explicitly says that altering passed string > should change the environment, i.e. putenv() directly puts its arg > into environment (unlike setenv() which just copies it there). > It means that putenv() can't be implemented via setenv() > (like we have before) at all. Putenv() value lives (allows modifying) > up to the next putenv() or setenv() call. Todays changes to *env() appears to have broken stuff (my -CURRENT box fails to build many ports after these changes, due to missing environment variables in the build environment). Here is a simple test-case: $ env -vi foo=bar env #env clearing environ #env setenv: foo=bar #env executing: env #env arg[0]= 'env' Notice that the second instance of env(1) doesn't see the $foo environment variable. This is the output of the same test on my RELENG_6 box: $ env -vi foo=bar env #env clearing environ #env setenv: foo=bar #env executing: env #env arg[0]= 'env' foo=bar Regards, Brix -- Henrik Brix Andersen <henrik@brixandersen.dk> [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) Comment: GnuPG signed iD8DBQFGNjcov+Q4flTiePgRAvjEAKCmKY0pBDCu0adHHfwVEbDyu/5hSACcCrS2 lK421DHkNGWi2B+G+/kT//I= =NxSs -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070430183624.GA73050>
