From bfa0044eccdae872c740f88a96d949d199e9b1b9 Mon Sep 17 00:00:00 2001 From: Jeff Hostetler Date: Wed, 29 Sep 2021 15:09:11 -0400 Subject: [PATCH] fixup! mingw: support long paths Revert the FSMonitor-related portions of 64da6f21825811a3bd8542f8617d950f0099b18c Signed-off-by: Jeff Hostetler --- compat/fsmonitor/fsm-listen-win32.c | 4 ++-- compat/fsmonitor/fsm-settings-win32.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compat/fsmonitor/fsm-listen-win32.c b/compat/fsmonitor/fsm-listen-win32.c index 9bb9293559..2431492c3a 100644 --- a/compat/fsmonitor/fsm-listen-win32.c +++ b/compat/fsmonitor/fsm-listen-win32.c @@ -113,9 +113,9 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state, DWORD share_mode = FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE; HANDLE hDir; - wchar_t wpath[MAX_LONG_PATH]; + wchar_t wpath[MAX_PATH]; - if (xutftowcs_long_path(wpath, path) < 0) { + if (xutftowcs_path(wpath, path) < 0) { error(_("could not convert to wide characters: '%s'"), path); return NULL; } diff --git a/compat/fsmonitor/fsm-settings-win32.c b/compat/fsmonitor/fsm-settings-win32.c index 83d91f85ec..39e907046f 100644 --- a/compat/fsmonitor/fsm-settings-win32.c +++ b/compat/fsmonitor/fsm-settings-win32.c @@ -76,8 +76,8 @@ static enum fsmonitor_reason is_virtual(struct repository *r) */ static enum fsmonitor_reason is_remote(struct repository *r) { - wchar_t wpath[MAX_LONG_PATH]; - wchar_t wfullpath[MAX_LONG_PATH]; + wchar_t wpath[MAX_PATH]; + wchar_t wfullpath[MAX_PATH]; size_t wlen; UINT driveType; @@ -85,7 +85,7 @@ static enum fsmonitor_reason is_remote(struct repository *r) * Do everything in wide chars because the drive letter might be * a multi-byte sequence. See win32_has_dos_drive_prefix(). */ - if (xutftowcs_long_path(wpath, r->worktree) < 0) + if (xutftowcs_path(wpath, r->worktree) < 0) return FSMONITOR_REASON_ZERO; /* @@ -103,7 +103,7 @@ static enum fsmonitor_reason is_remote(struct repository *r) * slashes to backslashes. This is essential to get GetDriveTypeW() * correctly handle some UNC "\\server\share\..." paths. */ - if (!GetFullPathNameW(wpath, MAX_LONG_PATH, wfullpath, NULL)) + if (!GetFullPathNameW(wpath, MAX_PATH, wfullpath, NULL)) return FSMONITOR_REASON_ZERO; driveType = GetDriveTypeW(wfullpath);