From: Eric Wong Date: Wed, 10 Feb 2021 19:57:59 +0000 (-0100) Subject: search: disallow spaces in argv approxidate queries X-Git-Tag: v1.7.0~1126 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bbeccd3d252c926e649b946a8a46dd14e6e92182;p=public-inbox.git 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"' --- 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/) {