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

Portability fix.

* js/access-nul-emulation-on-windows:
  msvc: avoid calling `access("NUL", flags)`
This commit is contained in:
Junio C Hamano 2021-04-20 17:23:37 -07:00
commit 4090b6973b

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 */