Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

putenv()/environ bug



As noticed here[1] following a change[2] in FreeBSD's *env() functions,
zsh is mixing *env() (putenv() in this case) functions with direct
access to the environ variable's contents against the IEEE Std 1003.1
specification.  For the FreeBSD port, there is an easy solution in the
thread to tell configure that putenv() does not exist.  I just wanted to
let the zsh development team know about this issue.

Regarding FreeBSD, if you replace the environ pointer, a call to
setenv(), putenv() or unsetenv() will detect this and update itself
internally.  getenv() will use environ until one of the other *env()
functions is called.  If you manipulate environ values after a call to
setenv(), putenv() or unsetenv() is made, then the change will go
unnoticed.

BTW, is there a particular reason the standard *env() functions cannot
be used for all operations to environ if found?

Sean
  1. http://lists.freebsd.org/pipermail/freebsd-current/2007-July/075541.html
  2. http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/041577.html
--
scf@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author