From: Erik Faye-Lund Date: Tue, 23 Nov 2010 18:38:28 +0000 (+0100) Subject: msvc: opendir: handle paths ending with a slash X-Git-Tag: v1.7.4-rc0~58^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad?ds=inline;hp=--cc msvc: opendir: handle paths ending with a slash Signed-off-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad diff --git a/compat/msvc.c b/compat/msvc.c index 199eb220f4..fdbfb70a62 100644 --- a/compat/msvc.c +++ b/compat/msvc.c @@ -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;