🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3707

Re: VERY odd TZ/putenv/tzset problem

#3707
From: Bill Dodd
Date: Wed, 03 May 2000 00:00
20 lines
1659 bytes
>>>>> "Tony" == admin  <admin@intergrafix.net> writes:

Tony> I've figured out HOW the problem occurs, i just dont know WHY
Tony> it occurs, or WHY it should occur. Possibly a bug in the c libs
Tony> or gcc??  The HOW is: when you putenv() an array, and then
Tony> modify the array afterwards, the environment automatically gets
Tony> changed without executing another putenv()! This, to me, sounds
Tony> ludicrous. Even setting the array below to static char doesn't
Tony> help.

That's the expected behavior of putenv().

From the man page for putenv:

   The memory space pointed to by the String parameter becomes part of
   the environment, so that altering the string effectively changes part
   of the environment.

-bill
Technical Details
Message-ID: <yeh7ldbbf1r.fsf@absinthe.austin.ibm.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <sh0jbc2j1g2120@corp.supernews.com> <sh0rs5c4a4n48@corp.supernews.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1033b0,f3cb935aae0fcff6
X-Google-Attributes: gid1033b0,public
X-Google-Thread: fc89c,f3cb935aae0fcff6
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 108717,f3cb935aae0fcff6
X-Google-Attributes: gid108717,public
From: Bill Dodd <bdodd@austin.ibm.com>
Subject: Re: VERY odd TZ/putenv/tzset problem
Date: 2000/05/03
Message-ID: <yeh7ldbbf1r.fsf@absinthe.austin.ibm.com>
X-Deja-AN: 618827758
References: <sh0jbc2j1g2120@corp.supernews.com> <sh0rs5c4a4n48@corp.supernews.com>
Content-Type: text/plain; charset=us-ascii
X-Face: 7Tn91tVJCThFrEU}_?^a02?=-p[NdbiJcpbSc#$3&?w*gL*dU\4{w3[*^C9 SI+%3I70:nr5E/FDIK\XF!MHk>"4\*!E{u0BO:E}l#VA*\/r9$Mon2v
Organization: IBM Austin
X-Attribution: Bill
Mime-Version: 1.0
User-Agent: Gnus/5.0804 (Gnus v5.8.4) XEmacs/21.1 (Canyonlands)
Newsgroups: comp.unix.programmer,comp.programming,gnu.misc