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:

committed by
Junio C Hamano

parent
9585ed519c
commit
e7772600e9
@ -23,6 +23,8 @@ DIR *opendir(const char *name)
|
|||||||
|
|
||||||
/* check that the pattern won't be too long for FindFirstFileA */
|
/* check that the pattern won't be too long for FindFirstFileA */
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
|
if (is_dir_sep(name[len - 1]))
|
||||||
|
len--;
|
||||||
if (len + 2 >= MAX_PATH) {
|
if (len + 2 >= MAX_PATH) {
|
||||||
errno = ENAMETOOLONG;
|
errno = ENAMETOOLONG;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user