cvs commit: src/usr.bin/env env.c

Tim Robbins tjr at freebsd.org
Mon Jun 20 09:41:06 GMT 2005


On Mon, Jun 20, 2005 at 03:14:29AM +0000, Garance A Drosehn wrote:
> gad         2005-06-20 03:14:29 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     usr.bin/env          env.c 
>   Log:
>   If the `utility' specified starts with a '/' character, then execute it
>   without checking it for an equals-sign.  If it starts with a slash, then
>   it cannot be a request to set the value of a valid environment variable.
>   
>   Approved by:    re (blanket `env')

This is not strictly correct:

	The value of an environment variable is a string of characters.
	For a C-language program, an array of strings called the
	environment shall be made available when a process begins. The
	array is pointed to by the external variable environ, which is
	defined as:

	extern char **environ;

	These strings have the form name=value; names shall not contain
	the character '='. For values to be portable across systems
	conforming to IEEE Std 1003.1-2001, the value shall be composed
	of characters from the portable character set (except NUL and as
	indicated below). There is no meaning associated with the order
	of strings in the environment. If more than one string in a
	process' environment has the same name, the consequences are
	undefined.

(The Open Group Base Specifications Issue 6, section 8.1)

Also, please be careful when adding new non-standard options and features;
they tend to stick around forever.


Tim


More information about the cvs-src mailing list