|
|
Message-ID: <20261111021257.GA5716@brightrain.aerifal.cx> Date: Tue, 10 Nov 2026 21:12:57 -0500 From: Rich Felker <dalias@...c.org> To: Bernie Innocenti <bernie@...ewiz.org> Cc: musl@...ts.openwall.com, Szabolcs Nagy <nsz@...t70.net> Subject: Re: [PATCH libc-test] functional/fnmatch: accept either reading of a backslash in brackets On Wed, Nov 11, 2026 at 09:09:50AM +0900, Bernie Innocenti wrote: > Without FNM_NOESCAPE, POSIX makes a backslash an escape character > inside a bracket expression too: XCU 2.13.1 in POSIX.1-2017 names > fnmatch() among the places where a backslash escapes the next > character, without an exception for brackets, and XCU 2.14.1 in > POSIX.1-2024 leaves it unspecified for the shell only. Then \] does > not close the bracket, and no bracket expression starts: "[[?*\]" and > "[]?*\]" match "[[" or "[]", then any character, any string and ']', > so neither matches its one-character test string. glibc reads them > that way; musl takes the backslash as an ordinary character, and both > match. Tests should not be modified to reflect observed implementation behavior, but should reflect the requirements of the standard, and should fail when an implementation doesn't meet those requirements. Recent discussion of the topic has concluded the musl interpretation is wrong, and I'll be merging patches to change it after the release. Rich
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.