Skip to content

Commit 8ac35e6

Browse files
kbleesdscho
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 4b600a7 commit 8ac35e6

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
@@ -1033,7 +1033,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
10331033
static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10341034
{
10351035
size_t namelen;
1036-
char alt_name[PATH_MAX];
1036+
char alt_name[MAX_LONG_PATH];
10371037

10381038
if (!do_lstat(follow, file_name, buf))
10391039
return 0;
@@ -1049,7 +1049,7 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10491049
return -1;
10501050
while (namelen && file_name[namelen-1] == '/')
10511051
--namelen;
1052-
if (!namelen || namelen >= PATH_MAX)
1052+
if (!namelen || namelen >= MAX_LONG_PATH)
10531053
return -1;
10541054

10551055
memcpy(alt_name, file_name, namelen);

0 commit comments

Comments
 (0)