Skip to content

Commit 4090b69

Browse files
committed
Merge branch 'js/access-nul-emulation-on-windows'
Portability fix. * js/access-nul-emulation-on-windows: msvc: avoid calling `access("NUL", flags)`
2 parents b9fa3ba + 9160068 commit 4090b69

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compat/mingw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,8 @@ ssize_t mingw_write(int fd, const void *buf, size_t len)
685685
int mingw_access(const char *filename, int mode)
686686
{
687687
wchar_t wfilename[MAX_PATH];
688+
if (!strcmp("nul", filename) || !strcmp("/dev/null", filename))
689+
return 0;
688690
if (xutftowcs_path(wfilename, filename) < 0)
689691
return -1;
690692
/* X_OK is not supported by the MSVCRT version */

0 commit comments

Comments
 (0)