Re: [PATCH v7 00/30] Builtin FSMonitor Part 3
- From
- Jeff Hostetler <git@jeffhostetler.com>
- Date
- May 24, 2022, 15:07 UTC
- Message-ID
- <dc1bd9f6-f83f-5cb1-9b0c-68d28a4cc216@jeffhostetler.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2205241357410.352@tvgsbejvaqbjf.bet>
On 5/24/22 8:00 AM, Johannes Schindelin wrote:
Show 25 quoted lines
> Hi Jeff,
>
> On Mon, 23 May 2022, Jeff Hostetler via GitGitGadget wrote:
>
>> 1: 8b7c5f4e23 ! 1: 26144c5865 fsm-listen-win32: handle shortnames
>> [...]
>> @@ compat/fsmonitor/fsm-listen-win32.c: static int normalize_path_in_utf8(FILE_NOTI
>> +{
>> + wchar_t buf_in[MAX_PATH + 1];
>> + wchar_t buf_out[MAX_PATH + 1];
>> -+ wchar_t *last_slash = NULL;
>> -+ wchar_t *last_bslash = NULL;
>> + wchar_t *last;
>> ++ wchar_t *p;
>> +
>> + /* build L"<wt-root-path>/.git" */
>> -+ wcscpy(buf_in, watch->wpath_longname);
>> -+ wcscpy(buf_in + watch->wpath_longname_len, L".git");
>> ++ swprintf(buf_in, ARRAY_SIZE(buf_in) - 1, L"%s.git",
>> ++ watch->wpath_longname);
>> +
>> -+ if (!GetShortPathNameW(buf_in, buf_out, MAX_PATH))
>> ++ if (!GetShortPathNameW(buf_in, buf_out, ARRAY_SIZE(buf_out)))
>
> Nice touch using `ARRAY_SIZE()` here!Thanks. And hopefully it will make the GFW downstream MAX_LONG_PATH fixups easier too.
Show 6 quoted lines
> > The changes look good to me, from my side this is good to go. > > Thank you so much! > Dscho >
Thanks for all your reviews. Jeff