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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,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 0A0161F9FE for ; Wed, 10 Feb 2021 19:58:00 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [RFC 2/2] search: disallow spaces in argv approxidate queries Date: Wed, 10 Feb 2021 18:57:59 -0100 Message-Id: <20210210195759.11108-3-e@80x24.org> In-Reply-To: <20210210195759.11108-1-e@80x24.org> References: <20210210195759.11108-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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(-) 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/) {