Add exponential backoff to rmdir() on Windows

This commit is contained in:
Justine Tunney
2021-01-29 21:46:23 -08:00
parent bf8b1623c8
commit eaca5b3e81
7 changed files with 38 additions and 16 deletions

View File

@@ -92,10 +92,8 @@ static textwindows noinline DIR *opendir$nt(const char *name) {
char16_t name16[PATH_MAX];
if ((len = __mkntpath(name, name16)) == -1) return NULL;
if (len + 2 + 1 > PATH_MAX) return PROGN(enametoolong(), NULL);
if (name16[len - 1] == u'/' || name16[len - 1] == u'\\') {
name16[--len] = u'\0';
}
name16[len++] = u'/';
while (name16[len - 1] == u'\\') name16[--len] = u'\0';
name16[len++] = u'\\';
name16[len++] = u'*';
name16[len] = u'\0';
if (!(res = calloc(1, sizeof(DIR)))) return NULL;