Subject: Re: [PATCH] prefix_path(): Unconditionally free result of prefix_path

From: Junio C Hamano <[email-masked]>
Date: Mon, 04 May 2015 15:29:32 -0700

Eric Sunshine <[email-masked]> writes:

> On Mon, May 4, 2015 at 3:11 PM, Stefan Beller <[email-masked]> wrote:
>> prefix_path(): Unconditionally free result of prefix_path
>
> Slightly redundant mention of "prefix_path". Also, prevailing custom
> is to drop capitalization.
>
>> prefix_path() always returns a newly allocated string since
>> d089eba (setup: sanitize absolute and funny paths in get_pathspec(),
>> 2008-01-28)
>
> I'd probably turn this sentence fragment into a proper sentence:
>
>     As of d089eba (...), prefix_path() always returns a newly
>     allocated string, so free its result unconditionally.
>
>> Additionally the const is dropped from the pointers, so the call to
>> free doesn't need a cast.
>
> Imperative mood:
>
>     Additionally, drop the const from variables to which the
>     prefix_path() result is assigned so they can be free()'d
>     without having to cast-away constness.
>
>> Signed-off-by: Stefan Beller <[email-masked]>
>> ---
>>
>> Notes:
>>     Thanks for all the suggestions!
>>     They are incorporated into this version of the patch.
>
> Thanks, this version looks much better.
>
> FWIW, with or without addressing the very minor nits above:
>
> Reviewed-by: Eric Sunshine <[email-masked]>

Thanks, both.

To save a round-trip, I'll munge the log message myself stealing
Eric's suggestions.