Re: [PATCH v7 00/30] Builtin FSMonitor Part 3
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 25, 2022, 10:23 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2205251223180.352@tvgsbejvaqbjf.bet>
- In-Reply-To
- <dc1bd9f6-f83f-5cb1-9b0c-68d28a4cc216@jeffhostetler.com>
Hi Jeff,
On Tue, 24 May 2022, Jeff Hostetler wrote:
Show 29 quoted lines
> On 5/24/22 8:00 AM, Johannes Schindelin wrote:
> >
> > 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.As a matter of fact, it already did!
Thank you, Dscho