From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OEVWGAEgsF6aTAAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 14:00:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wAu5GwsgsF7QFgAAB5/wlQ (envelope-from ) for ; Mon, 04 May 2020 14:00:43 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 325229425DF for ; Mon, 4 May 2020 14:00:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B7F996DE102E; Mon, 4 May 2020 07:00:34 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 QFXZR_J-e_6q; Mon, 4 May 2020 07:00:34 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 72ADC6DE0F88; Mon, 4 May 2020 07:00:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 0A21B6DE0F88 for ; Mon, 4 May 2020 07:00:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 DlYeKRC-vZEx for ; Mon, 4 May 2020 07:00:30 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 753DC6DE0F86 for ; Mon, 4 May 2020 07:00:30 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.92) (envelope-from ) id 1jVbe1-0007aP-Lh; Mon, 04 May 2020 10:00:29 -0400 Received: (nullmailer pid 1617709 invoked by uid 1000); Mon, 04 May 2020 14:00:28 -0000 From: David Bremner To: David Bremner , Franz Fellner , notmuch@notmuchmail.org Subject: [PATCH 2/2] lib: replace STRNCMP_LITERAL in __message_remove_indexed_terms Date: Mon, 4 May 2020 11:00:24 -0300 Message-Id: <20200504140024.1617656-2-david@tethera.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504140024.1617656-1-david@tethera.net> References: <87h7wvg6oq.fsf@tethera.net> <20200504140024.1617656-1-david@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -0.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-0.01 / 13.00]; GENERIC_REPUTATION(0.00)[-0.46578729693486]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:c]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.47)]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[tethera.net,gmail.com,notmuchmail.org]; RCVD_IN_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[david@tethera.net,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; DMARC_NA(0.00)[tethera.net]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: geYGFESuvH7Z strncmp looks for a prefix that matches, which is very much not what we want here. This fixes the bug reported by Franz Fellner in id:1588595993-ner-8.651@TPL520 --- lib/message.cc | 6 +++--- test/T700-reindex.sh | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index 5c9b58b2..0fa0eb3a 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -751,9 +751,9 @@ _notmuch_message_remove_indexed_terms (notmuch_message_t *message) const char *tag = notmuch_tags_get (tags); - if (STRNCMP_LITERAL (tag, "encrypted") != 0 && - STRNCMP_LITERAL (tag, "signed") != 0 && - STRNCMP_LITERAL (tag, "attachment") != 0) { + if (strcmp (tag, "encrypted") != 0 && + strcmp (tag, "signed") != 0 && + strcmp (tag, "attachment") != 0) { std::string term = tag_prefix + tag; message->doc.add_term (term); } diff --git a/test/T700-reindex.sh b/test/T700-reindex.sh index 7b7e52de..3d7c930d 100755 --- a/test/T700-reindex.sh +++ b/test/T700-reindex.sh @@ -34,7 +34,6 @@ notmuch dump > OUTPUT test_expect_equal_file initial-dump OUTPUT test_begin_subtest 'reindex preserves tags with special prefixes' -test_subtest_known_broken notmuch tag +attachment2 +encrypted2 +signed2 '*' notmuch dump > EXPECTED notmuch reindex '*' -- 2.26.2