summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-26 18:13:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-26 18:13:10 (GMT)
commit69c99b85e7f25b6a04bd28a2198538119bf1e1f0 (patch)
treee51dbfac05c68b0367e90301ae025deacfa2fdd9 /compat/mingw.c
parent9166bca8ba1ac008d36886648a8a4cf1b38a53fe (diff)
parent82ba1191ffeaf1482fce9fd9e72334c8dbc3bbbe (diff)
downloadgit-69c99b85e7f25b6a04bd28a2198538119bf1e1f0.zip
git-69c99b85e7f25b6a04bd28a2198538119bf1e1f0.tar.gz
git-69c99b85e7f25b6a04bd28a2198538119bf1e1f0.tar.bz2
Merge branch 'js/lstat-mingw-enotdir-fix' into maint
Fix to lstat() emulation on Windows. source: <pull.1291.v3.git.1659089152877.gitgitgadget@gmail.com> * js/lstat-mingw-enotdir-fix: lstat(mingw): correctly detect ENOTDIR scenarios
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index b550299..c5ca4eb 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -768,8 +768,8 @@ static int has_valid_directory_prefix(wchar_t *wfilename)
wfilename[n] = L'\0';
attributes = GetFileAttributesW(wfilename);
wfilename[n] = c;
- if (attributes == FILE_ATTRIBUTE_DIRECTORY ||
- attributes == FILE_ATTRIBUTE_DEVICE)
+ if (attributes &
+ (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE))
return 1;
if (attributes == INVALID_FILE_ATTRIBUTES)
switch (GetLastError()) {