Skip to content

Commit 590a1dc

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 bf48e14 commit 590a1dc

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
@@ -1008,7 +1008,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
10081008
static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10091009
{
10101010
size_t namelen;
1011-
char alt_name[PATH_MAX];
1011+
char alt_name[MAX_LONG_PATH];
10121012

10131013
if (!do_lstat(follow, file_name, buf))
10141014
return 0;
@@ -1024,7 +1024,7 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
10241024
return -1;
10251025
while (namelen && file_name[namelen-1] == '/')
10261026
--namelen;
1027-
if (!namelen || namelen >= PATH_MAX)
1027+
if (!namelen || namelen >= MAX_LONG_PATH)
10281028
return -1;
10291029

10301030
memcpy(alt_name, file_name, namelen);

0 commit comments

Comments
 (0)