Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de)
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: <Cygwin@Sourceware.Cygnus.Com>
Subject: putenv() - copying environment string violates Unix specs?
Date: Tue, 25 Jul 2000 11:00:26 +0400
Message-ID: <000e01bff606$02e2d500$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal

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

