1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-04-24 16:45:11 +02:00

Merge branch 'js/access-nul-emulation-on-windows' into next

Portability fix.

* js/access-nul-emulation-on-windows:
  msvc: avoid calling `access("NUL", flags)`
This commit is contained in:
Junio C Hamano 2021-04-16 15:37:19 -07:00
commit 3017437e51

View File

@ -685,6 +685,8 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
int mingw_access(const char *filename, int mode)
{
wchar_t wfilename[MAX_PATH];
if (!strcmp("nul", filename) || !strcmp("/dev/null", filename))
return 0;
if (xutftowcs_path(wfilename, filename) < 0)
return -1;
/* X_OK is not supported by the MSVCRT version */