Browse Source

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>
maint
Erik Faye-Lund 14 years ago committed by Junio C Hamano
parent
commit
e7772600e9
  1. 2
      compat/msvc.c

2
compat/msvc.c

@ -23,6 +23,8 @@ DIR *opendir(const char *name) @@ -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;

Loading…
Cancel
Save