1 Return-Path: <djcb@djcbsoftware.nl>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 334F2431FBC
\r
6 for <notmuch@notmuchmail.org>; Tue, 1 Dec 2009 23:11:31 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id Bv44v4QL9f+G for <notmuch@notmuchmail.org>;
\r
11 Tue, 1 Dec 2009 23:11:29 -0800 (PST)
\r
12 Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi
\r
14 by olra.theworths.org (Postfix) with ESMTP id 72CD9431FAE
\r
15 for <notmuch@notmuchmail.org>; Tue, 1 Dec 2009 23:11:29 -0800 (PST)
\r
16 Received: from djcbsoftware.nl (a88-112-254-208.elisa-laajakaista.fi
\r
18 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 56503151684;
\r
21 Wed, 2 Dec 2009 09:11:26 +0200 (EET)
\r
22 Received: by djcbsoftware.nl (Postfix, from userid 1000)
\r
23 id 1576339C034; Wed, 2 Dec 2009 09:11:25 +0200 (EET)
\r
24 From: "Dirk-Jan C. Binnema" <djcb.bulk@gmail.com>
\r
25 To: notmuch@notmuchmail.org
\r
26 Date: Wed, 2 Dec 2009 09:11:25 +0200
\r
27 Message-Id: <1259737885-15103-2-git-send-email-djcb.bulk@gmail.com>
\r
28 X-Mailer: git-send-email 1.6.3.3
\r
29 In-Reply-To: <1259737885-15103-1-git-send-email-djcb.bulk@gmail.com>
\r
30 References: <1259737885-15103-1-git-send-email-djcb.bulk@gmail.com>
\r
31 Subject: [notmuch] [PATCH 2/2] * free the response data from 'prompt'
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.12
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Wed, 02 Dec 2009 07:11:32 -0000
\r
46 Free the results of the prompt; this patch does the minimal job for that.
\r
47 It may be nice to refactor the function a bit.
\r
49 Signed-off-by: Dirk-Jan C. Binnema <djcb.bulk@gmail.com>
\r
51 notmuch-setup.c | 15 +++++++++++++--
\r
52 1 files changed, 13 insertions(+), 2 deletions(-)
\r
54 diff --git a/notmuch-setup.c b/notmuch-setup.c
\r
55 index 622bbaa..293c852 100644
\r
56 --- a/notmuch-setup.c
\r
57 +++ b/notmuch-setup.c
\r
58 @@ -119,12 +119,16 @@ notmuch_setup_command (unused (void *ctx),
\r
59 prompt ("Your full name [%s]: ", notmuch_config_get_user_name (config));
\r
60 if (strlen (response))
\r
61 notmuch_config_set_user_name (config, response);
\r
66 prompt ("Your primary email address [%s]: ",
\r
67 notmuch_config_get_user_primary_email (config));
\r
68 if (strlen (response))
\r
69 notmuch_config_set_user_primary_email (config, response);
\r
74 other_emails = g_ptr_array_new ();
\r
76 old_other_emails = notmuch_config_get_user_other_email (config,
\r
77 @@ -136,12 +140,17 @@ notmuch_setup_command (unused (void *ctx),
\r
79 g_ptr_array_add (other_emails, talloc_strdup (ctx,
\r
80 old_other_emails[i]));
\r
86 prompt ("Additional email address [Press 'Enter' if none]: ");
\r
87 if (strlen (response))
\r
88 g_ptr_array_add (other_emails, talloc_strdup (ctx, response));
\r
92 } while (strlen (response));
\r
93 if (other_emails->len)
\r
94 notmuch_config_set_user_other_email (config,
\r
95 @@ -158,6 +167,8 @@ notmuch_setup_command (unused (void *ctx),
\r
96 absolute_path = make_path_absolute (ctx, response);
\r
97 notmuch_config_set_database_path (config, absolute_path);
\r
102 if (! notmuch_config_save (config)) {
\r