From bbeccd3d252c926e649b946a8a46dd14e6e92182 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 10 Feb 2021 18:57:59 -0100 Subject: search: disallow spaces in argv approxidate queries 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 8e4cce33..520aa31d 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -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/) { -- cgit v1.2.3-24-ge0c7