Skip to content

Commit fe8de49

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 f8bde49 commit fe8de49

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
@@ -788,7 +788,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
788788
static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
789789
{
790790
int namelen;
791-
char alt_name[PATH_MAX];
791+
char alt_name[MAX_LONG_PATH];
792792

793793
if (!do_lstat(follow, file_name, buf))
794794
return 0;
@@ -804,7 +804,7 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
804804
return -1;
805805
while (namelen && file_name[namelen-1] == '/')
806806
--namelen;
807-
if (!namelen || namelen >= PATH_MAX)
807+
if (!namelen || namelen >= MAX_LONG_PATH)
808808
return -1;
809809

810810
memcpy(alt_name, file_name, namelen);

0 commit comments

Comments
 (0)