Skip to content

Commit

Permalink
fixup! mingw: remove 248-char limit when creating directories
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Mar 10, 2017
1 parent 94dafc3 commit 599fd1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ int mingw_mkdir(const char *path, int mode)
{
int ret;
wchar_t wpath[MAX_LONG_PATH];
if (xutftowcs_long_path(wpath, path) < 0)
/* CreateDirectoryW path limit is 248 (MAX_PATH - 8.3 file name) */
if (xutftowcs_path_ex(wpath, path, MAX_LONG_PATH, -1, 248,
core_long_paths) < 0)
return -1;

ret = _wmkdir(wpath);
Expand Down

0 comments on commit 599fd1d

Please sign in to comment.