Message ID | pull.704.git.1597660622615.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 680e0b4524482c4bb679030188f6ae8db4caff06 |
Headers | show |
Series | mingw: improve performance of mingw_unlink() | expand |
diff --git a/compat/mingw.c b/compat/mingw.c index 4454b3e67b..a00f331230 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -290,6 +290,9 @@ int mingw_unlink(const char *pathname) if (xutftowcs_path(wpathname, pathname) < 0) return -1; + if (DeleteFileW(wpathname)) + return 0; + /* read-only files cannot be removed */ _wchmod(wpathname, 0666); while ((ret = _wunlink(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {