Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0100018595893ac1-a4a3abcd-d50b-4907-a6bb-6a58d923e6b6-000000@email.amazonses.com>
Date: Mon, 9 Jan 2023 07:57:56 +0000
From: "(GalaxyMaster)" <galaxy@...nwall.com.au>
To: musl@...ts.openwall.com
Subject: Re: is fnmatch() a bit broken?

Rich,

On Mon, Jan 09, 2023 at 02:32:13AM -0500, Rich Felker wrote:
> > galaxy@...llo:~/musl-fnmatch $ ./musl-fnmatch
> > fnmatch("abc", "abc", 0) = 0 (expected: 0)
> > fnmatch("[1\]] [1\]]", "1 ]", 0) = 1 (expected: 0)
> 
> This difference is intentional because glibc's behavior is contrary to
> the spec.

Thanks for the explanation, today I learnt something :).  However, you said:

> A '\' can escape the '[' and make it non-special (not
> open a bracket) but the '-' inside the bracket is not "special" to
> begin with -- it's just part of the bracket syntax. Likewise with the
> closing ']' case.

Which brings a question on the "[1\]] [1\]]" use case not matching "1 ]".  If I
read your response correctly, it is expected to actually match on musl, did I
get it wrong?

-- 
(GM)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.