unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v3 11/15] cli/reply: check for NULL list first in scan_address_list()
Date: Tue, 13 Sep 2016 20:14:18 +0300	[thread overview]
Message-ID: <2ebd3f18a63d7652f3098d65d33bc290fd26fac4.1473786451.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1473786451.git.jani@nikula.org>
In-Reply-To: <cover.1473786451.git.jani@nikula.org>

Support passing NULL list later on. Also use it to simplify the
recursion.
---
 notmuch-reply.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9b78ea2c2b20..d90f46f9bed3 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -192,6 +192,9 @@ scan_address_list (InternetAddressList *list,
     int i;
     unsigned int n = 0;
 
+    if (list == NULL)
+	return 0;
+
     for (i = 0; i < internet_address_list_length (list); i++) {
 	address = internet_address_list_get_address (list, i);
 	if (INTERNET_ADDRESS_IS_GROUP (address)) {
@@ -200,9 +203,6 @@ scan_address_list (InternetAddressList *list,
 
 	    group = INTERNET_ADDRESS_GROUP (address);
 	    group_list = internet_address_group_get_members (group);
-	    if (group_list == NULL)
-		continue;
-
 	    n += scan_address_list (group_list, config, message, type, user_from);
 	} else {
 	    InternetAddressMailbox *mailbox;
-- 
2.1.4

  parent reply	other threads:[~2016-09-13 17:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 17:14 [PATCH v3 00/15] reply refactor, fixes Jani Nikula
2016-09-13 17:14 ` [PATCH v3 01/15] test: make it possible to have multiple corpora Jani Nikula
2016-09-13 17:14 ` [PATCH v3 02/15] test: add known broken test for reply to message with multiple Cc headers Jani Nikula
2016-09-13 17:14 ` [PATCH v3 03/15] cli/reply: push notmuch reply format abstraction lower in the stack Jani Nikula
2016-09-13 17:14 ` [PATCH v3 04/15] cli/reply: reuse show_reply_headers() in headers-only format Jani Nikula
2016-09-13 17:14 ` [PATCH v3 05/15] cli/reply: unify reply format functions Jani Nikula
2016-09-13 17:14 ` [PATCH v3 06/15] cli/reply: reorganize create_reply_message() Jani Nikula
2016-09-13 17:14 ` [PATCH v3 07/15] cli/reply: make references header creation easier to follow Jani Nikula
2016-09-13 17:14 ` [PATCH v3 08/15] cli/reply: reuse create_reply_message() also for headers-only format Jani Nikula
2016-09-13 17:14 ` [PATCH v3 09/15] cli/reply: reduce the reply format abstractions Jani Nikula
2016-09-13 17:14 ` [PATCH v3 10/15] cli/reply: use dedicated functions for reply to mapping Jani Nikula
2016-09-13 17:14 ` Jani Nikula [this message]
2016-09-13 17:14 ` [PATCH v3 12/15] cli/reply: return internet address list from get header funcs Jani Nikula
2016-09-13 17:14 ` [PATCH v3 13/15] cli/reply: do not parse Reply-To: header into internet address list twice Jani Nikula
2016-09-13 17:14 ` [PATCH v3 14/15] cli/reply: pass gmime message to Reply-To: redundancy detection Jani Nikula
2016-09-13 17:14 ` [PATCH v3 15/15] cli/reply: only pass gmime message to add recipients to reply message Jani Nikula
2016-09-13 19:03 ` [PATCH v3 00/15] reply refactor, fixes Tomi Ollila
2016-09-17 12:25 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ebd3f18a63d7652f3098d65d33bc290fd26fac4.1473786451.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).