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]

Re: putenv() - copying environment string violates Unix specs?


Andrej Borsenkow wrote:
> 
> 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?

You're right and I think it should possible to change that but
I'm not sure if that will make it into 1.1.3.

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company

--
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]