This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
putenv() - copying environment string violates Unix specs?
- To: <Cygwin at Sourceware dot Cygnus dot Com>
- Subject: putenv() - copying environment string violates Unix specs?
- From: "Andrej Borsenkow" <Andrej dot Borsenkow at mow dot siemens dot ru>
- Date: Tue, 25 Jul 2000 11:00:26 +0400
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