This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: putenv() - copying environment string violates Unix specs?
- To: Andrej Borsenkow <Andrej dot Borsenkow at mow dot siemens dot ru>
- Subject: Re: putenv() - copying environment string violates Unix specs?
- From: Corinna Vinschen <vinschen at cygnus dot com>
- Date: Tue, 25 Jul 2000 12:27:03 +0200
- CC: Cygwin at Sourceware dot Cygnus dot Com
- References: <000e01bff606$02e2d500$21c9ca95@mow.siemens.ru>
- Reply-To: cygwin <cygwin at sources dot redhat dot com>
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