summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-04-20 17:23:37 -0700
committerJunio C Hamano <gitster@pobox.com>2021-04-20 17:23:37 -0700
commit4090b6973b4c1574c70642b694f02f01768d7a69 (patch)
treeefa947aca3870fe5a1b6fe3f11a07978845dc5b7 /compat
parentb9fa3ba0ca0e82e69ae111e5e911464bd0488fb3 (diff)
parent9160068ac6ec52d119c97bf778c44787b93d81d1 (diff)
downloadgit-4090b6973b4c1574c70642b694f02f01768d7a69.tar.gz
Merge branch 'js/access-nul-emulation-on-windows'
Portability fix. * js/access-nul-emulation-on-windows: msvc: avoid calling `access("NUL", flags)`
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index a43599841c..aa647b367b 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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 */