Skip to content

Commit 3060d86

Browse files
kbleesGit for Windows Build Agent
authored andcommitted
Win32: fix 'lstat("dir/")' with long paths
Use a suffciently large buffer to strip the trailing slash. Signed-off-by: Karsten Blees <[email protected]>
1 parent 3b04488 commit 3060d86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compat/mingw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
10351035
static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10361036
{
10371037
size_t namelen;
1038-
char alt_name[PATH_MAX];
1038+
char alt_name[MAX_LONG_PATH];
10391039

10401040
if (!do_lstat(follow, file_name, buf))
10411041
return 0;
@@ -1051,7 +1051,7 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10511051
return -1;
10521052
while (namelen && file_name[namelen-1] == '/')
10531053
--namelen;
1054-
if (!namelen || namelen >= PATH_MAX)
1054+
if (!namelen || namelen >= MAX_LONG_PATH)
10551055
return -1;
10561056

10571057
memcpy(alt_name, file_name, namelen);

0 commit comments

Comments
 (0)