Re: [PATCH v4 12/12] t3070: disable two fnmatch tests that have different results on different libc

2012-10-12 Thread Johannes Sixt
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.

-- Hannes
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 12/12] t3070: disable two fnmatch tests that have different results on different libc

2012-10-12 Thread Nguyen Thai Ngoc Duy
On Fri, Oct 12, 2012 at 2:22 PM, Johannes Sixt j.s...@viscovery.net wrote:
 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
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 12/12] t3070: disable two fnmatch tests that have different results on different libc

2012-10-10 Thread Nguyễn Thái Ngọc Duy
fnmatch on glibc-2.12.1 returns no match. glibc-2.15 returns ok.

Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com
---
 t/t3070-wildmatch.sh | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index f21da6c..38042eb 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -13,6 +13,8 @@ match() {
fi 
if [ $2 = 1 ]; then
test-wildmatch fnmatch '$3' '$4'
+   elif [ $2 = x ]; then
+   true
else
! test-wildmatch fnmatch '$3' '$4'
fi
@@ -129,8 +131,8 @@ match 1 1 ']' '[\]]'
 match 0 0 '\]' '[\]]'
 match 0 0 '\' '[\]]'
 match 0 0 'ab' 'a[]b'
-match 0 1 'a[]b' 'a[]b'
-match 0 1 'ab[' 'ab['
+match 0 x 'a[]b' 'a[]b'
+match 0 x 'ab[' 'ab['
 match 0 0 'ab' '[!'
 match 0 0 'ab' '[-'
 match 1 1 '-' '[-]'
-- 
1.7.12.1.406.g6ab07c4

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html