Skip to content

Commit

Permalink
Merge branch 'js/lstat-mingw-enotdir-fix' into jch
Browse files Browse the repository at this point in the history
Fix to lstat() emulation on Windows.

* js/lstat-mingw-enotdir-fix:
  lstat(mingw): correctly detect ENOTDIR scenarios
  • Loading branch information
gitster committed Jul 29, 2022
2 parents 59cf9b3 + 82ba119 commit 51c139a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,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()) {
Expand Down

0 comments on commit 51c139a

Please sign in to comment.