Re: [PATCH v7 00/30] Builtin FSMonitor Part 3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!

The changes look good to me, from my side this is good to go.

Thank you so much!
Dscho



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux