Re: [PATCH 03/16] urlmatch: add url_is_valid_pattern() helper
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Apr 27, 2026, 12:42 UTC
- Message-ID
- <CAP8UFD2AwxJCNdgdL4KSRdRdeSdapTkAbFj6pzcy8w4gOczM2A@mail.gmail.com>
- In-Reply-To
- <acUkpJjHgYs0jqX4@pks.im>
On Thu, Mar 26, 2026 at 1:20 PM Patrick Steinhardt <ps@pks.im> wrote:
> > On Mon, Mar 23, 2026 at 09:05:06AM +0100, Christian Couder wrote:
Show 20 quoted lines
> > +bool url_is_valid_pattern(const char *url)
> > +{
> > + char *normalized = url_normalize_1(url, NULL, true);
> > +
> > + if (normalized) {
> > + free(normalized);
> > + return true;
> > + }
> > +
> > + return false;
> > +}
>
> We could simplify this implementation to:
>
> bool url_is_valid_pattern(const char *url)
> {
> char *normalized = url_normalize_1(url, NULL, true);
> free(normalized);
> return !!normalized;
> }Thanks for the suggestion but this patch has been replaced by a patch adding url_normalize_pattern() in the v2 I just sent.