Skip to content

Commit 599fd1d

Browse files
committed
fixup! mingw: remove 248-char limit when creating directories
Actually, this commit was totally misguided. The path length limit for non-long paths (at least before Windows 10 build 1067 with long paths opted in) *is* 248, and we still want to convert to Root Local Device Path if that limit is reached. I misread the intention of the code when I made that patch to "remove the 248-char limit", thinking that there was a hard limit to 248 characters even in the long path case, which was incorrect. Simply revert that commit and be done. This fixes #1084 Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 94dafc3 commit 599fd1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compat/mingw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ int mingw_mkdir(const char *path, int mode)
496496
{
497497
int ret;
498498
wchar_t wpath[MAX_LONG_PATH];
499-
if (xutftowcs_long_path(wpath, path) < 0)
499+
/* CreateDirectoryW path limit is 248 (MAX_PATH - 8.3 file name) */
500+
if (xutftowcs_path_ex(wpath, path, MAX_LONG_PATH, -1, 248,
501+
core_long_paths) < 0)
500502
return -1;
501503

502504
ret = _wmkdir(wpath);

0 commit comments

Comments
 (0)