@@ -25,7 +25,7 @@ struct one_watch
2525 DWORD count ;
2626
2727 struct strbuf path ;
28- wchar_t wpath_longname [MAX_PATH + 1 ];
28+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
2929 DWORD wpath_longname_len ;
3030
3131 HANDLE hDir ;
@@ -128,8 +128,8 @@ static int normalize_path_in_utf8(wchar_t *wpath, DWORD wpath_len,
128128 */
129129static void check_for_shortnames (struct one_watch * watch )
130130{
131- wchar_t buf_in [MAX_PATH + 1 ];
132- wchar_t buf_out [MAX_PATH + 1 ];
131+ wchar_t buf_in [MAX_LONG_PATH + 1 ];
132+ wchar_t buf_out [MAX_LONG_PATH + 1 ];
133133 wchar_t * last_slash = NULL ;
134134 wchar_t * last_bslash = NULL ;
135135 wchar_t * last ;
@@ -138,7 +138,7 @@ static void check_for_shortnames(struct one_watch *watch)
138138 wcscpy (buf_in , watch -> wpath_longname );
139139 wcscpy (buf_in + watch -> wpath_longname_len , L".git" );
140140
141- if (!GetShortPathNameW (buf_in , buf_out , MAX_PATH ))
141+ if (!GetShortPathNameW (buf_in , buf_out , MAX_LONG_PATH ))
142142 return ;
143143
144144 last_slash = wcsrchr (buf_out , L'/' );
@@ -196,8 +196,8 @@ static enum get_relative_result get_relative_longname(
196196 const wchar_t * wpath , DWORD wpath_len ,
197197 wchar_t * wpath_longname )
198198{
199- wchar_t buf_in [2 * MAX_PATH + 1 ];
200- wchar_t buf_out [MAX_PATH + 1 ];
199+ wchar_t buf_in [2 * MAX_LONG_PATH + 1 ];
200+ wchar_t buf_out [MAX_LONG_PATH + 1 ];
201201 DWORD root_len ;
202202
203203 /* Build L"<wt-root-path>/<event-rel-path>" */
@@ -211,7 +211,7 @@ static enum get_relative_result get_relative_longname(
211211 * shortname or a longname. This routine allows either to be
212212 * given as input.
213213 */
214- if (!GetLongPathNameW (buf_in , buf_out , MAX_PATH )) {
214+ if (!GetLongPathNameW (buf_in , buf_out , MAX_LONG_PATH )) {
215215 /*
216216 * The shortname to longname conversion can fail for
217217 * various reasons, for example if the file has been
@@ -275,10 +275,10 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
275275 FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE ;
276276 HANDLE hDir ;
277277 DWORD len_longname ;
278- wchar_t wpath [MAX_PATH + 1 ];
279- wchar_t wpath_longname [MAX_PATH + 1 ];
278+ wchar_t wpath [MAX_LONG_PATH + 1 ];
279+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
280280
281- if (xutftowcs_path (wpath , path ) < 0 ) {
281+ if (xutftowcs_long_path (wpath , path ) < 0 ) {
282282 error (_ ("could not convert to wide characters: '%s'" ), path );
283283 return NULL ;
284284 }
@@ -293,7 +293,7 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
293293 return NULL ;
294294 }
295295
296- if (!GetLongPathNameW (wpath , wpath_longname , MAX_PATH )) {
296+ if (!GetLongPathNameW (wpath , wpath_longname , MAX_LONG_PATH )) {
297297 error (_ ("[GLE %ld] could not get longname of '%s'" ),
298298 GetLastError (), path );
299299 CloseHandle (hDir );
@@ -522,7 +522,7 @@ static int process_worktree_events(struct fsmonitor_daemon_state *state)
522522 struct string_list cookie_list = STRING_LIST_INIT_DUP ;
523523 struct fsmonitor_batch * batch = NULL ;
524524 const char * p = watch -> buffer ;
525- wchar_t wpath_longname [MAX_PATH + 1 ];
525+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
526526
527527 /*
528528 * If the kernel gets more events than will fit in the kernel
0 commit comments