This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

putenv() - copying environment string violates Unix specs?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]