develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991116.002] perl5.005_02: my_setenv() and Term::ReadLine::Gnu

From:
Ilya Zakharevich
Date:
November 18, 1999 18:04
Subject:
Re: [ID 19991116.002] perl5.005_02: my_setenv() and Term::ReadLine::Gnu
Message ID:
19991118210401.A16532@monk.mps.ohio-state.edu
On Fri, Nov 19, 1999 at 01:37:35AM +0100, Joerg Schumacher wrote:
> > a) Perl uses PL_origenviron variable to understand when environ is malloc()ed.
> > 
> >    You do not claim that this scheme is broken (though AFAICS, it will
> >    work correct only if perl_parse is called only once).
> 
> On the contrary: I do believe that the check 
> 
> 	(environ == PL_origenviron) /* need we copy environment? */
> 
> is broken.  This test would only be OK if perl itself could guarantee
> that no extension module modifies environ behind the scene.

I do not believe this.  At least the documentation I see states that
putenv() will malloc() environ if it needs to modify it.  Thus with
usemymalloc=n the test is OK as is.

Ilya



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About