зеркало из https://github.com/microsoft/git.git
Win32: fix 'lstat("dir/")' with long paths
Use a suffciently large buffer to strip the trailing slash. Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
Родитель
0c9e71a376
Коммит
e6e5e40f2e
|
@ -871,7 +871,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf)
|
|||
static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
|
||||
{
|
||||
int namelen;
|
||||
char alt_name[PATH_MAX];
|
||||
char alt_name[MAX_LONG_PATH];
|
||||
|
||||
if (!do_lstat(follow, file_name, buf))
|
||||
return 0;
|
||||
|
@ -887,7 +887,7 @@ static int do_stat_internal(int follow, const char *file_name, struct stat *buf)
|
|||
return -1;
|
||||
while (namelen && file_name[namelen-1] == '/')
|
||||
--namelen;
|
||||
if (!namelen || namelen >= PATH_MAX)
|
||||
if (!namelen || namelen >= MAX_LONG_PATH)
|
||||
return -1;
|
||||
|
||||
memcpy(alt_name, file_name, namelen);
|
||||
|
|
Загрузка…
Ссылка в новой задаче