mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
msvc: opendir: handle paths ending with a slash
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9585ed519c
commit
e7772600e9
|
@ -23,6 +23,8 @@ DIR *opendir(const char *name)
|
|||
|
||||
/* check that the pattern won't be too long for FindFirstFileA */
|
||||
len = strlen(name);
|
||||
if (is_dir_sep(name[len - 1]))
|
||||
len--;
|
||||
if (len + 2 >= MAX_PATH) {
|
||||
errno = ENAMETOOLONG;
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue