Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2013 05:43:13 +0700
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: Proper way to access executable's "environment"?
Message-ID:  <20130527054313.372869c1@X220.ovitrap.com>
In-Reply-To: <20130526172015.GA1334@albert.catwhisker.org>
References:  <20130526172015.GA1334@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Sun, 26 May 2013 10:20:15 -0700
David Wolfskill <david@catwhisker.org> wrote:

> So I started looking at code that I had reason to expect would do this
> correctly -- src/usr.bin/env/env.c, for starters -- and saw that while
> piewm's twm.c declares main as:
> 
> int
> main(int argc, char **argv, char **environ)
> {

I use this concept since decades but with different names. Could it be
a problem of overlapping names?
> ...
> 
> and proceeds to use environ as a pointer to a NULL-terminated list
> of strings, env.c declares:
> 
> extern char **environ;

The advantage would be - and also the disadvantage - that every piece
of the code could have access to the environment.

That's why I moved away from it.

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130527054313.372869c1>