Skip to content

Commit eea2ae1

Browse files
committed
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 <[email protected]>
1 parent 0116b0e commit eea2ae1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compat/mingw.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,8 @@ int mingw_chdir(const char *dirname)
614614
int result;
615615
DECLARE_PROC_ADDR(kernel32.dll, DWORD, GetFinalPathNameByHandleW,
616616
HANDLE, LPWSTR, DWORD, DWORD);
617-
wchar_t wdirname[MAX_PATH];
618-
/* SetCurrentDirectoryW doesn't support long paths */
619-
if (xutftowcs_path(wdirname, dirname) < 0)
617+
wchar_t wdirname[MAX_LONG_PATH];
618+
if (xutftowcs_long_path(wdirname, dirname) < 0)
620619
return -1;
621620

622621
if (has_symlinks && INIT_PROC_ADDR(GetFinalPathNameByHandleW)) {

0 commit comments

Comments
 (0)