Skip to content

Commit 56a0141

Browse files
committed
fixup! mingw: support long paths
Let's re-apply the long-paths part of FSMonitor, after v4 was merged. We also need to handle a new instance in `fsm-settings-win32.c` that wasn't there in v2. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bcf4d40 commit 56a0141

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compat/fsmonitor/fsm-listen-win32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
113113
DWORD share_mode =
114114
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE;
115115
HANDLE hDir;
116-
wchar_t wpath[MAX_PATH];
116+
wchar_t wpath[MAX_LONG_PATH];
117117

118-
if (xutftowcs_path(wpath, path) < 0) {
118+
if (xutftowcs_long_path(wpath, path) < 0) {
119119
error(_("could not convert to wide characters: '%s'"), path);
120120
return NULL;
121121
}

compat/fsmonitor/fsm-settings-win32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ static enum fsmonitor_reason is_virtual(struct repository *r)
7676
*/
7777
static enum fsmonitor_reason is_remote(struct repository *r)
7878
{
79-
wchar_t wpath[MAX_PATH];
80-
wchar_t wfullpath[MAX_PATH];
79+
wchar_t wpath[MAX_LONG_PATH];
80+
wchar_t wfullpath[MAX_LONG_PATH];
8181
size_t wlen;
8282
UINT driveType;
8383

8484
/*
8585
* Do everything in wide chars because the drive letter might be
8686
* a multi-byte sequence. See win32_has_dos_drive_prefix().
8787
*/
88-
if (xutftowcs_path(wpath, r->worktree) < 0)
88+
if (xutftowcs_long_path(wpath, r->worktree) < 0)
8989
return FSMONITOR_REASON_ZERO;
9090

9191
/*
@@ -103,7 +103,7 @@ static enum fsmonitor_reason is_remote(struct repository *r)
103103
* slashes to backslashes. This is essential to get GetDriveTypeW()
104104
* correctly handle some UNC "\\server\share\..." paths.
105105
*/
106-
if (!GetFullPathNameW(wpath, MAX_PATH, wfullpath, NULL))
106+
if (!GetFullPathNameW(wpath, MAX_LONG_PATH, wfullpath, NULL))
107107
return FSMONITOR_REASON_ZERO;
108108

109109
driveType = GetDriveTypeW(wfullpath);

0 commit comments

Comments
 (0)