From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OIg2GDMbjGJkSgEAbAwnHQ (envelope-from ) for ; Tue, 24 May 2022 01:39:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wDY4FzMbjGKaQQAAG6o9tA (envelope-from ) for ; Tue, 24 May 2022 01:39:31 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C73B1F749 for ; Tue, 24 May 2022 01:39:30 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ACF9A5F787; Mon, 23 May 2022 23:39:13 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id F3EB65F720 for ; Mon, 23 May 2022 23:39:09 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 13C6B5FC01; Mon, 23 May 2022 19:39:08 -0400 (EDT) Received: (nullmailer pid 3506959 invoked by uid 1000); Mon, 23 May 2022 23:39:02 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 7/8] lib/message: check return status from _n_m_add_{path,folder}_terms Date: Mon, 23 May 2022 20:39:00 -0300 Message-Id: <20220523233901.3506880-8-david@tethera.net> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220523233901.3506880-1-david@tethera.net> References: <20220523233901.3506880-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TIQEUAX5IO3UFVMH36UR22LTW54JUYPZ X-Message-ID-Hash: TIQEUAX5IO3UFVMH36UR22LTW54JUYPZ X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653349171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=xyOqiNCtY65Cr5lC8JWO43RA+WolVcf2fVL5NGmUAQ4=; b=Uyb8D+Fd1FF0uY4UjyzQ7F8Wsuksqd+7Gp7YQjmznvLBM9dxGJcJ8fHslma1HAhDlqvebr kkSydreq4w14eV8jnvcE9eFqG4huoG3mMwhy7E48Ec2tlsY/jc+aPdeI2JTdgeBNPZSJr2 eaI9TjD0SNCrHbFeQjIKgrDOpxowcufBnN7yHekK4nP/aaRnUwDIJmCvXsAezsUikKfjHh ph9jodFD1PDXmVrzaoal9QJ4dtpvRnMSx0KxT4zvYw/wDNrtZDCtKVmvHT6BpJITW8J78X eeOmesW9UNKGlK7UvYsbLaGLgX7cJmXyqddOUkick64lTJJeNe3NY4AoCcsrmw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653349171; a=rsa-sha256; cv=none; b=jro/bjZKBuBRvdNUhqlw2a32Gj5wiygI2Eq0ZnhjCTTwTx7qExsuNZqLIcw6C5/42/k24C hIsSsIGT2cWYg6AyPd+0tMaUPLdGv5DYbhe7x5nmw3Fa/K48X/2MtRsVd5xakScedxVjkf t5xxCrN1VvqUi2p4LdhfOCv5/d2t9E1O/tgTd/nzFw3S/Mjwm3vPoOM474KAyGW9B3tRFW kGGiKpUsn6XaoHHsASVKUPoAADGZIzQbSETQOVFxXvUvvPY8prqWlA4tEIxDDF3i8XppPn yYZqrW0BVBOZ5+VughLr9C7TJmhaqIy1XVRUhKBCJ1Xsms6JFMoZjpu5KZyFag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.00 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1C73B1F749 X-Spam-Score: -2.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: AFnttefH5wOv Mainly to propagate information about Xapian exceptions. --- lib/message.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/message.cc b/lib/message.cc index 94be0f76..ae152df7 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -791,7 +791,7 @@ is_maildir (const char *p) } /* Add "folder:" term for directory. */ -static notmuch_status_t +NODISCARD static notmuch_status_t _notmuch_message_add_folder_terms (notmuch_message_t *message, const char *directory) { @@ -841,7 +841,7 @@ _notmuch_message_add_folder_terms (notmuch_message_t *message, #define RECURSIVE_SUFFIX "/**" /* Add "path:" terms for directory. */ -static notmuch_status_t +NODISCARD static notmuch_status_t _notmuch_message_add_path_terms (notmuch_message_t *message, const char *directory) { @@ -897,6 +897,7 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message) const char *direntry, *directory; char *colon; const std::string &term = *i; + notmuch_status_t term_status; /* Terminate loop at first term without desired prefix. */ if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len)) @@ -917,8 +918,13 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message) message->notmuch, directory_id); - _notmuch_message_add_folder_terms (message, directory); - _notmuch_message_add_path_terms (message, directory); + term_status = _notmuch_message_add_folder_terms (message, directory); + if (term_status) + return term_status; + + term_status = _notmuch_message_add_path_terms (message, directory); + if (term_status) + return term_status; } return status; @@ -962,8 +968,13 @@ _notmuch_message_add_filename (notmuch_message_t *message, if (status) return status; - _notmuch_message_add_folder_terms (message, directory); - _notmuch_message_add_path_terms (message, directory); + status = _notmuch_message_add_folder_terms (message, directory); + if (status) + return status; + + status = _notmuch_message_add_path_terms (message, directory); + if (status) + return status; talloc_free (local); -- 2.35.2