]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei q: make HTTP(S) query strings even less ugly
authorEric Wong <e@80x24.org>
Wed, 10 Nov 2021 10:28:37 +0000 (10:28 +0000)
committerEric Wong <e@80x24.org>
Wed, 10 Nov 2021 18:38:17 +0000 (18:38 +0000)
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

index 29df07e0c8a82e3a97ad620eaa59d4dccb2ee4c2..2958d3f910b0986baa2bccf138ee185ae35b8c7f 100644 (file)
@@ -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};