From eea2ae1120ea80f45041e72d1d4e31e868a9d2eb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 20 May 2016 14:39:12 +0200 Subject: [PATCH] fixup! Win32: support long paths A recent fix by Stefan Beller forces `git submodule` to use absolute paths all around. This, however, breaks our tests because all of a sudden, a relative path that was just barely within the maximal path size now extends it as an absolute path. A brief test on this developer's Windows 10 showed, though, that the claim that "SetCurrentDirectoryW doesn't support long paths" does not hold up to reality: simply lifting the limitation still works, and even better: it lets t7413 pass (and it does not pass with Stefan's patch). Signed-off-by: Johannes Schindelin --- compat/mingw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 240f29ae19..74e2feff00 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -614,9 +614,8 @@ int mingw_chdir(const char *dirname) int result; DECLARE_PROC_ADDR(kernel32.dll, DWORD, GetFinalPathNameByHandleW, HANDLE, LPWSTR, DWORD, DWORD); - wchar_t wdirname[MAX_PATH]; - /* SetCurrentDirectoryW doesn't support long paths */ - if (xutftowcs_path(wdirname, dirname) < 0) + wchar_t wdirname[MAX_LONG_PATH]; + if (xutftowcs_long_path(wdirname, dirname) < 0) return -1; if (has_symlinks && INIT_PROC_ADDR(GetFinalPathNameByHandleW)) {