From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3CFF81F5AE; Thu, 30 Jul 2020 08:03:54 +0000 (UTC) Date: Thu, 30 Jul 2020 08:03:54 +0000 From: Eric Wong To: Kyle Meyer Cc: meta@public-inbox.org Subject: Re: [PATCH] wwwlisting: fix grep call for match=domain filtering Message-ID: <20200730080353.GA14766@dcvr> References: <20200730053055.30972-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200730053055.30972-1-kyle@kyleam.com> List-Id: Kyle Meyer wrote: > The grep call in list_match_domain_i returns true for all inboxes, > even ones without a URL that matches the regular expression, because > the qr value passed to grep is not surrounded by slashes. Add them. > > Fixes: 1988d730c0088e8b (config: support multi-value inbox.*.*url) Thanks, pushed as commit 41ecd08ee60daa495de3a2fc2c0296dc9cc9a0b3 > sub list_match_domain_i { > my ($ibx, $arg) = @_; > my ($list, $hide_key, $re) = @$arg; > - if (!$ibx->{-hide}->{$hide_key} && grep($re, @{$ibx->{url}})) { > + if (!$ibx->{-hide}->{$hide_key} && grep(/$re/, @{$ibx->{url}})) { Gah, I keep getting languages/behaviors confused :x Especially confusing since `$string =~ $re' is documented in perlop(1) as being equivalent to `$string =~ /$re/'