From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11820 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: fnmatch bug? escaping of '-' and ']' inside [...] does not work. Date: Tue, 15 Aug 2017 10:28:16 -0400 Message-ID: <20170815142816.GU1627@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1502807311 32161 195.159.176.226 (15 Aug 2017 14:28:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Aug 2017 14:28:31 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11833-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 15 16:28:28 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dhcpW-00086a-T8 for gllmg-musl@m.gmane.org; Tue, 15 Aug 2017 16:28:27 +0200 Original-Received: (qmail 18037 invoked by uid 550); 15 Aug 2017 14:28:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 17968 invoked from network); 15 Aug 2017 14:28:28 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11820 Archived-At: On Tue, Aug 15, 2017 at 03:12:17PM +0200, Denys Vlasenko wrote: > Moving bbox build to musl did uncover one definite bug. > bbox has gazillion tests for its shells, and one of them > started failing. I added debug printout and with it, > the following fnmatch calls give different results now: > > ash: fnmatch(pattern:'[a\-c]',str:'-',0):1 > ash: fnmatch(pattern:'[\]]',str:']',0):1 > ash: fnmatch(pattern:'[a\]]',str:']',0):1 > > glibc and uclibc threat the above as a match. I believe this is connected to a known discrepancy between what the standard seems to say and what glibc is doing. I'll see if I can dig up past discussions of it. If it's coming up again, it's likely that this is an issue that needs a proper interpretation (and possibly fix in the language of the standard, if the current text really does imply something different than what it's supposed to; the fix might end up being along the lines of "it's unspecified whether..."). Rich