Re: [BUG/PATCH] setup: Copy an environment variable to avoid overwrites
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jan 5, 2013, 06:24 UTC
- Message-ID
- <CACsJy8CZe=qyzmG_1vdLYp07OvkDAU4wYc8MN3et7WBVmMhJOQ@mail.gmail.com>
- In-Reply-To
- <7vk3rsqm6u.fsf@alter.siamese.dyndns.org>
On Sat, Jan 5, 2013 at 11:38 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> I personally do not think a wrapper with limited slots is a healthy > direction to go. Most places we use getenv() do not let the return > value live across their scope, and those that do should explicitly > copy the value away. It's between validating that there is _no_ *env() > calls in the codepath between a getenv() call and the use of its > return value, and validating that there is at most 4 such calls there. > The former is much easier to verify and maintain, I think.
I did not look carefully and was scared of 143 getenv calls. But with about 4 calls, yes it's best to do without the wrapper.
-- Duy