summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat/msvc.c2
1 files changed, 2 insertions, 0 deletions
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;