]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: disallow spaces in argv approxidate queries
authorEric Wong <e@80x24.org>
Wed, 10 Feb 2021 19:57:59 +0000 (18:57 -0100)
committerEric Wong <e@80x24.org>
Thu, 11 Feb 2021 19:15:14 +0000 (19:15 +0000)
This is for consistency with --stdin and WWW front ends
which can't distinguish between phrase searches and
prefix ranges used for d:/dt:/rt:.

In any case, I expect users on the lei command-line are more
likely to use `5.days.ago' instead of `"5 days ago"'

lib/PublicInbox/Search.pm

index 8e4cce33f5f6eb267d480da59e3f6b59a9d01fe5..520aa31d3a05371fd9697692e1bd1171a45c0a2a 100644 (file)
@@ -337,7 +337,7 @@ sub query_argv_to_string {
        my (undef, $git, $argv) = @_;
        my $to_parse;
        my $tmp = join(' ', map {;
-               if (s!\b(d|rt|dt):([[:print:]]+)\z!date_parse_prepare(
+               if (s!\b(d|rt|dt):(\S+)\z!date_parse_prepare(
                                                $to_parse //= [], $1, $2)!sge) {
                        $_;
                } elsif (/\s/) {