From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5740 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?5p6X5Yag5YSS?= Newsgroups: gmane.linux.lib.musl.general Subject: fnmatch.h bug? Date: Wed, 6 Aug 2014 11:01:40 +0800 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158cba0f2fcc104ffed30b8 X-Trace: ger.gmane.org 1407297068 19101 80.91.229.3 (6 Aug 2014 03:51:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 03:51:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5745-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 06 05:50:58 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XEsFc-0004aH-Fn for gllmg-musl@plane.gmane.org; Wed, 06 Aug 2014 05:50:56 +0200 Original-Received: (qmail 28324 invoked by uid 550); 6 Aug 2014 03:50:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30327 invoked from network); 6 Aug 2014 03:01:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nibUMMuYjuR397nI5qyKE/eylMcVCeGcHS6zIESwPSg=; b=OV/IlLWrmtV8EqTEnkq+manSvsbKi274pPgAwncwCmwvuUW9fGWaq1Sihu8tFnhDS8 uv01uA0bmgWgQ0rlZDP4ZdhqaQ04wpfa1mefvVwskuxTQ4tZJ3Jh2Io2vCPhYALm/Kmc jsYr5W0XNQS7KtqD/F/BqXDb+AM+vNtCoWACNDE5IxoytKUXBn7qGnJSZn2exkudTHjw 8WGEZPntdTjiy6da2JTRtXyUmLXi5094+LvMFbUWAyZn3P30xcvYhEVHroQPCCWatjFx cT/1XcjijakVmvHd0L74VS21rEqgFYB3v6OKNCJgJ+9EmpQvAXBE9m/DmQUj3pmy8GVc mgeA== X-Received: by 10.152.30.100 with SMTP id r4mr8155580lah.87.1407294100403; Tue, 05 Aug 2014 20:01:40 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:5740 Archived-At: --089e0158cba0f2fcc104ffed30b8 Content-Type: text/plain; charset=UTF-8 When I using the musl-libc "fnmatch" function, I found that the return value is different from glibc. For example: musl-libc: i = fnmatch( "a\\.c" , "a\.c" , 0 ); // it will return 0 -> i = 0 glibc: i = fnmatch( "a\\.c" , "a\.c" , 0 ); // it will also return 0 -> i = 0 So, we know that "a.\\c" will escape " \ " in pattern and will NOT escape in string. But in the case: musl-libc: i = fnmatch( "[[?*\\]" , "\\" , 0 ); // it will return 0 -> i = 0 glibc: i = fnmatch( "[[?*\\]" , "\\" , 0 ); // it will return 1 -> i = 1 The return value is DIFFERENT ! I am confuse which library is wrong? If you have any idea, please response me and send an e-mail to me, Thank you! --089e0158cba0f2fcc104ffed30b8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
When I u= sing the musl-<= span tabindex=3D"-1" id=3D":11w.2" style class=3D"">libc "fnmatch" functi= on, I found that the return value is different from glibc.

For example:

musl-libc:
=C2=A0=C2=A0=C2=A0=C2=A0 i =3D fnmatch( "a\\.c" , = "a\.c" , 0 ); // it will return 0 -> i =3D 0
glibc:
=C2=A0=C2=A0 =C2=A0 i =3D fnmatch( "a\\.c" , "a\.c" , 0 ); // i= t will also return 0 -> i =3D 0

So, we know that "a.\\c" will escape " \ " in= pattern and will NOT escape in string.

But in the case:
musl-<= span tabindex=3D"-1" id=3D":11w.11" style class=3D"">libc:
=C2=A0=C2=A0=C2=A0=C2=A0 i =3D fnmatch( "[[?*\\]" , "\\" , 0 );= // it will return 0 -> i =3D 0
glibc:
=C2=A0=C2=A0=C2=A0=C2=A0 i =3D fnmatch( "[[?*\\]" , "\\" , 0 ); // <= span style=3D"color:rgb(255,0,0)">it will return 1 -> i =3D 1
=

The return value is DIFFERENT !
I a= m confuse which library is wrong?
If you have any idea, pleas= e response me and send an e-mail to me,
Thank you!
--089e0158cba0f2fcc104ffed30b8--