Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2584F429E27 for ; Tue, 13 Sep 2011 14:32:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XaubFvPaVBYp for ; Tue, 13 Sep 2011 14:32:25 -0700 (PDT) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 69EFB429E29 for ; Tue, 13 Sep 2011 14:32:25 -0700 (PDT) Received: from localhost6.localdomain6 (entry3.nixu.fi [193.209.237.21]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p8DLW8G3022252; Wed, 14 Sep 2011 00:32:17 +0300 From: tomi.ollila@iki.fi To: notmuch@notmuchmail.org Subject: [PATCH 2/3] Made notmuch_config_get_new_tags() use notmuch_talloc_g_key_file_get_string_list(). Date: Wed, 14 Sep 2011 00:32:03 +0300 Message-Id: <1315949524-4948-3-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1315949524-4948-1-git-send-email-tomi.ollila@iki.fi> References: <1315949524-4948-1-git-send-email-tomi.ollila@iki.fi> Cc: Tomi Ollila X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Tue, 13 Sep 2011 21:32:26 -0000 From: Tomi Ollila --- notmuch-config.c | 26 +++++--------------------- 1 files changed, 5 insertions(+), 21 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 706f481..648639b 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -606,29 +606,13 @@ const char ** notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length) { - char **tags; - size_t tags_length; - unsigned int i; - if (config->new_tags == NULL) { - tags = g_key_file_get_string_list (config->key_file, - "new", "tags", - &tags_length, NULL); - if (tags) { - config->new_tags = talloc_size (config, - sizeof (char *) * - (tags_length + 1)); - for (i = 0; i < tags_length; i++) - config->new_tags[i] = talloc_strdup (config->new_tags, - tags[i]); - config->new_tags[i] = NULL; - - g_strfreev (tags); - - config->new_tags_length = tags_length; - } + config->new_tags = notmuch_talloc_g_key_file_get_string_list( + config, + config->key_file, + "new", "tags", + &config->new_tags_length, NULL); } - *length = config->new_tags_length; return config->new_tags; } -- 1.7.3.4