From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DFCCD6DE1BC4 for ; Fri, 3 Mar 2017 05:23:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F6vXTpJ6BV46 for ; Fri, 3 Mar 2017 05:23:20 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 4171E6DE1BC2 for ; Fri, 3 Mar 2017 05:23:20 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cjnAM-0000Eg-P6; Fri, 03 Mar 2017 08:22:38 -0500 Received: (nullmailer pid 4835 invoked by uid 1000); Fri, 03 Mar 2017 13:23:16 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH] fixup! lib: regexp matching in 'subject' and 'from' Date: Fri, 3 Mar 2017 09:23:05 -0400 Message-Id: <20170303132305.4793-1-david@tethera.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170227023422.26929-3-david@tethera.net> References: <20170227023422.26929-3-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 13:23:21 -0000 --- lib/regexp-fields.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc index b2b39504..65108e38 100644 --- a/lib/regexp-fields.cc +++ b/lib/regexp-fields.cc @@ -62,6 +62,11 @@ RegexpPostingSource::init (const Xapian::Database &db) it_ = db_.valuestream_begin (slot_); end_ = db.valuestream_end (slot_); started_ = false; + + /* make sure we start on a matching value */ + while (!at_end() && regexec (®exp_, (*it_).c_str (), 0, NULL, 0) != 0) { + ++it_; + } } Xapian::doccount -- 2.11.0