summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-08 13:13:14 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-08 13:13:14 -0700
commit6c5fbd866c89d939d6202a2594658234d4cf1e90 (patch)
tree1b8aa66339311b8206f76b317f20f75f165461ed /compat
parent8dfa09f49f58dc1458bea485789f5c07a48be9a3 (diff)
parent82ba1191ffeaf1482fce9fd9e72334c8dbc3bbbe (diff)
downloadgit-6c5fbd866c89d939d6202a2594658234d4cf1e90.tar.gz
Merge branch 'js/lstat-mingw-enotdir-fix'
Fix to lstat() emulation on Windows. * js/lstat-mingw-enotdir-fix: lstat(mingw): correctly detect ENOTDIR scenarios
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index b5502997e2..c5ca4eb4a9 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()) {