Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251007013308.GI1827@brightrain.aerifal.cx>
Date: Mon, 6 Oct 2025 21:33:08 -0400
From: Rich Felker <dalias@...c.org>
To: raf <musl@....org>
Cc: musl@...ts.openwall.com, raf <raf@....org>
Subject: Re: [PATCH] fnmatch: add bare minimum support for character
 equivalents (e.g. [[=e=]])

On Sun, Oct 05, 2025 at 10:00:33AM +1100, raf wrote:
> From: raf <raf@....org>
> 
> ---
>  src/regex/fnmatch.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/regex/fnmatch.c b/src/regex/fnmatch.c
> index 978fff88..b8c71afa 100644
> --- a/src/regex/fnmatch.c
> +++ b/src/regex/fnmatch.c
> @@ -146,6 +146,12 @@ static int match_bracket(const char *p, int k, int kfold)
>  				    iswctype(kfold, wctype(buf)))
>  					return !inv;
>  			}
> +			if (z == '=' && *p0) {
> +				wchar_t wc2;
> +				int l = mbtowc(&wc2, p0, 4);
> +				if (l < 0) return 0;
> +				if (wc2==k || wc2==kfold) return !inv;
> +			}
>  			continue;
>  		}
>  		if (*p < 128U) {
> -- 
> 2.39.5

I haven't reviewed the implementation but making this change seems
desirable.

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.