putenv() - copying environment string violates Unix specs?

Andrej Borsenkow Andrej.Borsenkow@mow.siemens.ru
Tue Jul 25 00:01:00 GMT 2000


According to putenv() description SUS V2, the argument is used "as is"
and never copied. Cygwin version of putenv() explicitly copies argument
(actually, multiple times - first in putenv() and then in setenv()).
This is horribly confusing for programs that expect to manage
environment strings themselves and/or have own memory allocator (like
Zsh). It means, that every use must be checked and free'ing of
environment string put under #ifdef __CYGWIN__

Is there any particular reason for this? Is there any chance that it may
be changed to be more Unix-compatible?

-andrej

Have a nice DOS!
B >>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list