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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,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 E92EE1FA11 for ; Wed, 10 Nov 2021 10:28:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] lei q: make HTTP(S) query strings even less ugly Date: Wed, 10 Nov 2021 10:28:37 +0000 Message-Id: <20211110102837.41819-1-e@80x24.org> In-Reply-To: <20211110102511.40960-1-e@80x24.org> References: <20211110102511.40960-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Following commit 57fed2e4b78ed394 (lei: normalize whitespace in remote queries, 2021-09-11), leaving the trailing `\n' from stdin queries to be normalized to ` ' (SP) causes it to appear as `+' in URLs, which Xapian ignores. --- lib/PublicInbox/LeiXSearch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 29df07e0c8a8..2958d3f910b0 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -342,7 +342,7 @@ sub query_remote_mboxrd { local $SIG{TERM} = sub { exit(0) }; # for DESTROY (File::Temp, $reap) my $lei = $self->{lei}; my $opt = $lei->{opt}; - my $qstr = $lei->{mset_opt}->{qstr}; + chomp(my $qstr = $lei->{mset_opt}->{qstr}); $qstr =~ s/[ \n\t]+/ /sg; # make URLs less ugly my @qform = (x => 'm'); push(@qform, t => 1) if $opt->{threads};