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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-05-20 14:39:12 +02:00
parent 0116b0e3b5
commit eea2ae1120

View File

@@ -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)) {