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: http://git.tremily.us/?a=commitdiff_plain;h=e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad;p=git.git msvc: opendir: handle paths ending with a slash Signed-off-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- diff --git a/compat/msvc.c b/compat/msvc.c index 199eb220f..fdbfb70a6 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;