Message ID | pull.1291.v3.git.1659089152877.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 82ba1191ffeaf1482fce9fd9e72334c8dbc3bbbe |
Headers | show |
Series | [v3] lstat(mingw): correctly detect ENOTDIR scenarios | expand |
diff --git a/compat/mingw.c b/compat/mingw.c index 545e952a588..3b85bb02536 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -471,8 +471,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()) {