summaryrefslogtreecommitdiff
path: root/compat/msvc.c
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2010-11-23 18:38:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-24 00:06:47 (GMT)
commite7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad (patch)
tree44a5d87517b14a3a2711ed0f9ba6470d31932379 /compat/msvc.c
parent9585ed519c59d5ac46f8e12b339220cdd0567b7d (diff)
downloadgit-e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad.zip
git-e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad.tar.gz
git-e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad.tar.bz2
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>
Diffstat (limited to 'compat/msvc.c')
-rw-r--r--compat/msvc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compat/msvc.c b/compat/msvc.c
index 199eb22..fdbfb70 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;