diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-04-20 17:23:37 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-04-20 17:23:37 -0700 |
| commit | 4090b6973b4c1574c70642b694f02f01768d7a69 (patch) | |
| tree | efa947aca3870fe5a1b6fe3f11a07978845dc5b7 | |
| parent | Merge branch 'sg/bugreport-fixes' (diff) | |
| parent | msvc: avoid calling `access("NUL", flags)` (diff) | |
| download | git-4090b6973b4c1574c70642b694f02f01768d7a69.tar.gz git-4090b6973b4c1574c70642b694f02f01768d7a69.zip | |
Merge branch 'js/access-nul-emulation-on-windows'
Portability fix.
* js/access-nul-emulation-on-windows:
msvc: avoid calling `access("NUL", flags)`
| -rw-r--r-- | compat/mingw.c | 2 |
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 */ |
