@@ -25,7 +25,7 @@ struct one_watch
25
25
DWORD count ;
26
26
27
27
struct strbuf path ;
28
- wchar_t wpath_longname [MAX_PATH + 1 ];
28
+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
29
29
DWORD wpath_longname_len ;
30
30
31
31
HANDLE hDir ;
@@ -128,8 +128,8 @@ static int normalize_path_in_utf8(wchar_t *wpath, DWORD wpath_len,
128
128
*/
129
129
static void check_for_shortnames (struct one_watch * watch )
130
130
{
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 ];
133
133
wchar_t * last_slash = NULL ;
134
134
wchar_t * last_bslash = NULL ;
135
135
wchar_t * last ;
@@ -138,7 +138,7 @@ static void check_for_shortnames(struct one_watch *watch)
138
138
wcscpy (buf_in , watch -> wpath_longname );
139
139
wcscpy (buf_in + watch -> wpath_longname_len , L".git" );
140
140
141
- if (!GetShortPathNameW (buf_in , buf_out , MAX_PATH ))
141
+ if (!GetShortPathNameW (buf_in , buf_out , MAX_LONG_PATH ))
142
142
return ;
143
143
144
144
last_slash = wcsrchr (buf_out , L'/' );
@@ -196,8 +196,8 @@ static enum get_relative_result get_relative_longname(
196
196
const wchar_t * wpath , DWORD wpath_len ,
197
197
wchar_t * wpath_longname )
198
198
{
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 ];
201
201
DWORD root_len ;
202
202
203
203
/* Build L"<wt-root-path>/<event-rel-path>" */
@@ -211,7 +211,7 @@ static enum get_relative_result get_relative_longname(
211
211
* shortname or a longname. This routine allows either to be
212
212
* given as input.
213
213
*/
214
- if (!GetLongPathNameW (buf_in , buf_out , MAX_PATH )) {
214
+ if (!GetLongPathNameW (buf_in , buf_out , MAX_LONG_PATH )) {
215
215
/*
216
216
* The shortname to longname conversion can fail for
217
217
* various reasons, for example if the file has been
@@ -271,10 +271,10 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
271
271
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE ;
272
272
HANDLE hDir ;
273
273
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 ];
276
276
277
- if (xutftowcs_path (wpath , path ) < 0 ) {
277
+ if (xutftowcs_long_path (wpath , path ) < 0 ) {
278
278
error (_ ("could not convert to wide characters: '%s'" ), path );
279
279
return NULL ;
280
280
}
@@ -289,7 +289,7 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
289
289
return NULL ;
290
290
}
291
291
292
- if (!GetLongPathNameW (wpath , wpath_longname , MAX_PATH )) {
292
+ if (!GetLongPathNameW (wpath , wpath_longname , MAX_LONG_PATH )) {
293
293
error (_ ("[GLE %ld] could not get longname of '%s'" ),
294
294
GetLastError (), path );
295
295
CloseHandle (hDir );
@@ -518,7 +518,7 @@ static int process_worktree_events(struct fsmonitor_daemon_state *state)
518
518
struct string_list cookie_list = STRING_LIST_INIT_DUP ;
519
519
struct fsmonitor_batch * batch = NULL ;
520
520
const char * p = watch -> buffer ;
521
- wchar_t wpath_longname [MAX_PATH + 1 ];
521
+ wchar_t wpath_longname [MAX_LONG_PATH + 1 ];
522
522
523
523
/*
524
524
* If the kernel gets more events than will fit in the kernel
0 commit comments