Re: [BUG/PATCH] setup: Copy an environment variable to avoid overwrites
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2013, 04:32 UTC
- Message-ID
- <7vobh4qmgl.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vsj6gqvhc.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> ... So even if the standard allowed the > returned value to be volatile across calls to getenv(3),... > ... > In fact, > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html > > says that only ...
Apparently I wasn't even reading what I was quoting carefully enough. The above does include getenv() as one of the functions that are allowed to invalidate earlier return values.
Sorry about that. I'll go back to bed (I am a bit under the weather and OOO today). The conclusion in my original message is still valid.
> Having said that, we do have codepaths to update a handful of > environment variables ourselves (GIT_DIR is among them), so I think > your patch is a good safety measure in general.