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:
Erik Faye-Lund 2010-11-23 19:38:28 +01:00 committed by Junio C Hamano
parent 9585ed519c
commit e7772600e9

View File

@ -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;