diff --git a/compat/mingw.c b/compat/mingw.c index 81898fa101e17f..e592e635290d80 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -508,6 +508,9 @@ int mingw_unlink(const char *pathname) if (xutftowcs_long_path(wpathname, pathname) < 0) return -1; + if (DeleteFileW(wpathname)) + return 0; + do { /* read-only files cannot be removed */ _wchmod(wpathname, 0666);