@@ -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
@@ -271,10 +271,10 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
271271 FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE ;
272272 HANDLE hDir ;
273273 DWORD len_longname ;
274- wchar_t wpath [MAX_PATH + 1 ];
275- wchar_t wpath_longname [MAX_PATH + 1 ];
274+ wchar_t wpath [MAX_LONG_PATH + 1 ];
275+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
276276
277- if (xutftowcs_path (wpath , path ) < 0 ) {
277+ if (xutftowcs_long_path (wpath , path ) < 0 ) {
278278 error (_ ("could not convert to wide characters: '%s'" ), path );
279279 return NULL ;
280280 }
@@ -289,7 +289,7 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
289289 return NULL ;
290290 }
291291
292- if (!GetLongPathNameW (wpath , wpath_longname , MAX_PATH )) {
292+ if (!GetLongPathNameW (wpath , wpath_longname , MAX_LONG_PATH )) {
293293 error (_ ("[GLE %ld] could not get longname of '%s'" ),
294294 GetLastError (), path );
295295 CloseHandle (hDir );
@@ -518,7 +518,7 @@ static int process_worktree_events(struct fsmonitor_daemon_state *state)
518518 struct string_list cookie_list = STRING_LIST_INIT_DUP ;
519519 struct fsmonitor_batch * batch = NULL ;
520520 const char * p = watch -> buffer ;
521- wchar_t wpath_longname [MAX_PATH + 1 ];
521+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
522522
523523 /*
524524 * If the kernel gets more events than will fit in the kernel
0 commit comments