Re: [PATCH 41/68] init: use strbufs to store paths
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Oct 3, 2015, 21:12 UTC
- Message-ID
- <561044AD.8010803@web.de>
- In-Reply-To
- <xmqqtwq73nbj.fsf@gitster.mtv.corp.google.com>
On 03.10.15 18:54, Junio C Hamano wrote:
Show 27 quoted lines
> Torsten Bögershausen <tboegi@web.de> writes:
>
>> On 30.09.15 02:23, Jeff King wrote:
>>> On Tue, Sep 29, 2015 at 04:50:39PM -0700, Michael Blume wrote:
>>>
>>>> I see compile errors on my mac:
>>>>
>>
>> This is my attempt, passing the test, but not fully polished.
>
> Thanks.
>
>> diff --git a/builtin/init-db.c b/builtin/init-db.c
>> index 89f2c05..60b559c 100644
>> --- a/builtin/init-db.c
>> +++ b/builtin/init-db.c
>> @@ -276,7 +276,9 @@ static int create_default_files(const char *template_path)
>> path = git_path_buf(&buf, "CoNfIg");
>> if (!access(path, F_OK))
>> git_config_set("core.ignorecase", "true");
>> - probe_utf8_pathname_composition(path);
>> + /* Probe utf-8 normalization withou mangling CoNfIG */
>> + path = git_path_buf(&buf, "config");
>> + probe_utf8_pathname_composition(path, strlen(path));
>
> Hmph, Peff's quick-fix passed the original "CoNfIg" in &buf directly
> to probe_utf8_pathname_composition() without changing its signature.True, ( I was thinking that the test did only work on case insensitive FS). We can skip that change.
Beside that, I later realized, that a better signature could be: +void probe_utf8_pathname_composition(const char *path, size_t len)
I can send a proper patch the next days.