From owner-freebsd-stable@FreeBSD.ORG Sun Apr 6 22:16:20 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5261C106564A for ; Sun, 6 Apr 2008 22:16:20 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 381EC8FC13 for ; Sun, 6 Apr 2008 22:16:20 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 31C841CC038; Sun, 6 Apr 2008 15:16:20 -0700 (PDT) Date: Sun, 6 Apr 2008 15:16:20 -0700 From: Jeremy Chadwick To: Doug Hardie Message-ID: <20080406221620.GA73124@eos.sc1.parodius.com> References: <1794897B-7A36-412A-8849-87F10268EBAE@lafn.org> <20080406214524.GA72199@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: FreeBSD Stable Subject: Re: getenv in FreeBSD 7 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2008 22:16:20 -0000 On Sun, Apr 06, 2008 at 03:02:44PM -0700, Doug Hardie wrote: > On Apr 6, 2008, at 14:45, 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 > > Did that prior to my original posting. I find nothing there on it. The manpage change is documented in revision 1.27. See my other mail documenting proof that the manpages do in fact document the change: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getenv.3 Using that commit message as a cross-reference, we can correlate the commit in getenv.c -- revision 1.9: http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getenv.c http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/getenv.c.diff?r1=1.8;r2=1.9;f=h -- | 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 |