comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@callnetuk.com>
Subject: Re: ada/c if - putenv?
Date: 2000/03/14
Date: 2000-03-14T00:00:00+00:00	[thread overview]
Message-ID: <38ce8e41@eeyore.callnetuk.com> (raw)
In-Reply-To: 38C53194.EE4BAC3E@mindspring.com

I think I may have come across this one before. I believe there are some
well-known UNIXen which implement putenv contrary to the manual, in that
they only add a pointer to the argument to the environment, rather than
actually allocating a new string and copying the characters in (aaaargh!).
The result is, of course, that deallocating the argument afterwards knackers
the environment (causing crashes, spurious behaviour, or whatever).

Of course, doesn't this one case just perfectly exemplify the true awfulness
of both UNIX (and its derivatives) and C?

--
Nick Roberts
http://www.adapower.com/lab/adaos

"Al Johnston" <sofeise@mindspring.com> wrote in message
news:38C53194.EE4BAC3E@mindspring.com...

> Will someone please explain why the following program does not
> work?.  If I set the env manually and remove the call to putenv
> from the test case, the call to getenv works okay... but when
> I let the test code call putenv, not only does the getenv call
> not return the value given it by the putenv call, but it does
> not even get the old (manually set) value...







      parent reply	other threads:[~2000-03-14  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-07  0:00 ada/c if - putenv? Al Johnston
2000-03-07  0:00 ` Jeff Carter
2000-03-08  0:00   ` Geoff Bull
2000-03-07  0:00     ` Al Johnston
2000-03-14  0:00 ` Nick Roberts [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox