getenv in FreeBSD 7

Jeremy Chadwick koitsu at freebsd.org
Sun Apr 6 21:52:37 UTC 2008


On Sun, Apr 06, 2008 at 02:45:24PM -0700, Jeremy Chadwick wrote:
> On Sun, Apr 06, 2008 at 02:37:06PM -0700, Doug Hardie wrote:
> > Somewhere between FreeBSD 6.2 and 7.0 getenv has been changed to return a 
> > null if an environment variable is set but has no value.  I don't find 
> > anything anywhere in the documentation/man pages on this.  As a result, you 
> > cannot distinguish between a variable that is not set and one that is set 
> > to a value of "".  Is this a bug or a feature change?
> 
> I'd begin peeking here:
> 
> http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getenv.c

Follow-up: the manpages between 6.3-PRERELEASE and 7.0-STABLE do
document said change:

http://www.freebsd.org/cgi/man.cgi?query=getenv&apropos=0&sektion=3&manpath=FreeBSD+6.3-RELEASE&format=html

http://www.freebsd.org/cgi/man.cgi?query=getenv&apropos=0&sektion=3&manpath=FreeBSD+7.0-stable&format=html

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |



More information about the freebsd-stable mailing list