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 +AbzF4/zDF/YBgAA0tVLHw (envelope-from ) for ; Mon, 13 Jul 2020 23:51:43 +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 QJ/GE4/zDF/ILQAAB5/wlQ (envelope-from ) for ; Mon, 13 Jul 2020 23:51:43 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A079D940368 for ; Mon, 13 Jul 2020 23:51:41 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 760421FC90; Mon, 13 Jul 2020 19:51:30 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id B22FF1F70C for ; Mon, 13 Jul 2020 19:51:27 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id D21A35FFD4; Mon, 13 Jul 2020 19:51:25 -0400 (EDT) Received: (nullmailer pid 543468 invoked by uid 1000); Mon, 13 Jul 2020 23:51:12 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH] cli/new: replace newly deprecated n_m_has_maildir_flag Date: Mon, 13 Jul 2020 20:51:07 -0300 Message-Id: <20200713235107.543422-1-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711183008.1593624-6-david@tethera.net> References: <20200711183008.1593624-6-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: F5R4CEY5SSNIRIUHFLP7LVHEJKWA226H X-Message-ID-Hash: F5R4CEY5SSNIRIUHFLP7LVHEJKWA226H 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; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: 7IzBXqYEcNee Boolean return values have no out-of-band-values to signal errors. The change here is that a (somewhat unlikely) fatal error after indexing will now be caught. --- notmuch-new.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index f079f62a..4075d395 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -388,8 +388,11 @@ add_file (notmuch_database_t *notmuch, const char *filename, notmuch_message_maildir_flags_to_tags (message); for (tag = state->new_tags; *tag != NULL; tag++) { - if (strcmp ("unread", *tag) != 0 || - ! notmuch_message_has_maildir_flag (message, 'S')) { + notmuch_bool_t is_set; + /* Currently all errors from has_maildir_flag are fatal */ + if ((status = notmuch_message_has_maildir_flag_st (message, 'S', &is_set))) + goto DONE; + if (strcmp ("unread", *tag) != 0 || ! is_set) { notmuch_message_add_tag (message, *tag); } } -- 2.27.0