Re: [PATCH v4 12/12] t3070: disable two fnmatch tests that have different results on different libc
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Oct 12, 2012, 09:49 UTC
- Message-ID
- <CACsJy8DkxT70M9EWGF4rFebQUcDguJqCHkrW3CL3pBi0cAegUQ@mail.gmail.com>
- In-Reply-To
- <5077C52E.2050000@viscovery.net>
On Fri, Oct 12, 2012 at 2:22 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 7 quoted lines
> Am 10/10/2012 12:40, schrieb Nguyễn Thái Ngọc Duy: >> fnmatch on glibc-2.12.1 returns no match. glibc-2.15 returns ok. > > There are many more cases that fail with the fnmatch() that we ship in > compat/fnmatch. To test this on Linux, you have to remove the "#if defined > _LIBC || !defined __GNU_LIBRARY__" brackets from compat/fnmatch/fnmatch.c > and build with NO_FNMATCH.
Thanks. The point of checking against fnmatch is to make sure that wildmatch does not divert in behavior from fnmatch. For some corner cases that behavior is undefined, I think it is ok for different fnmatch versions to behave differently.
But some of failed tests make me worry about fnmatch. compat/fnmatch for example does not match '**/foo' with '/foo' (it does '*/foo' with '/foo'). 'A' is matched with '[[:digit:][:space:][:upper:]]' but not '[[:digit:][:upper:][:space:]]'. Perhaps we better off convert git to use wildmatch only to keep matching behavior more reliable. wildmatch does not support non-FNM_PATHNAME mode, but that should be easy to fix. The only downside I see is fnmatch may support locale while wildmatch does not.
-- Duy