Re: [PATCH v2] lstat(mingw): correctly detect ENOTDIR scenarios
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 28, 2022, 17:37 UTC
- Message-ID
- <xmqq8rodcf5i.fsf@gitster.g>
- In-Reply-To
- <pull.1291.v2.git.1659018558989.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
> In that code, the return value of `GetFileAttributesW()` is interpreted > as an enum value, not as a bit field, so that a perfectly fine leading > directory can be misdetected as "not a directory".
Nicely analyzed. So after all ENOTDIR was a buggy response and by fixing it we help all callers of lstat(), as pointed out in the earlier review.
> * Thanks to Eric's excellent review, the reporter and I dug deeper and > figured out the real bug (and fix).
Yeah, thanks all.
Will queue.