From e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 23 Nov 2010 19:38:28 +0100 Subject: [PATCH] msvc: opendir: handle paths ending with a slash Signed-off-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- compat/msvc.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.26.2