[PATCH v2 05/16] Use a blank _notmuch_crypto to choose the default gpg_path
[notmuch-archives.git] / 49 / 9b59ca72818188cd52e83d521dd114e1cfe428
1 Return-Path: <dkg@fifthhorseman.net>\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 arlo.cworth.org (Postfix) with ESMTP id D1D786DE1601\r
6  for <notmuch@notmuchmail.org>; Tue, 19 Jan 2016 18:53:29 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.023\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.023 tagged_above=-999 required=5\r
12  tests=[AWL=-0.023] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id o8HbBTfU5oTB for <notmuch@notmuchmail.org>;\r
16  Tue, 19 Jan 2016 18:53:28 -0800 (PST)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 940A16DE173B\r
19  for <notmuch@notmuchmail.org>; Tue, 19 Jan 2016 18:53:16 -0800 (PST)\r
20 Received: from fifthhorseman.net (unknown [38.109.115.130])\r
21  by che.mayfirst.org (Postfix) with ESMTPSA id B2940F98B\r
22  for <notmuch@notmuchmail.org>; Tue, 19 Jan 2016 21:53:12 -0500 (EST)\r
23 Received: by fifthhorseman.net (Postfix, from userid 1000)\r
24  id DC72E2036B; Tue, 19 Jan 2016 18:53:10 -0800 (PST)\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
26 To: Notmuch Mail <notmuch@notmuchmail.org>\r
27 Subject: [PATCH v2 05/16] Use a blank _notmuch_crypto to choose the default\r
28  gpg_path\r
29 Date: Tue, 19 Jan 2016 21:52:38 -0500\r
30 Message-Id: <1453258369-7366-6-git-send-email-dkg@fifthhorseman.net>\r
31 X-Mailer: git-send-email 2.7.0.rc3\r
32 In-Reply-To: <1453258369-7366-1-git-send-email-dkg@fifthhorseman.net>\r
33 References: <1453258369-7366-1-git-send-email-dkg@fifthhorseman.net>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.20\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38  <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
40  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Wed, 20 Jan 2016 02:53:30 -0000\r
47 \r
48 This way we're only choosing a default in one place.\r
49 ---\r
50  notmuch-config.c | 3 ++-\r
51  1 file changed, 2 insertions(+), 1 deletion(-)\r
52 \r
53 diff --git a/notmuch-config.c b/notmuch-config.c\r
54 index d252bb2..7cd19a7 100644\r
55 --- a/notmuch-config.c\r
56 +++ b/notmuch-config.c\r
57 @@ -418,7 +418,8 @@ notmuch_config_open (void *ctx,\r
58      }\r
59  \r
60      if (notmuch_config_get_crypto_gpg_path (config) == NULL) {\r
61 -       notmuch_config_set_crypto_gpg_path (config, "gpg");\r
62 +       _notmuch_crypto_t crypto = { .gpg_path = NULL };\r
63 +       notmuch_config_set_crypto_gpg_path (config, _notmuch_crypto_get_gpg_path (&crypto));\r
64      }\r
65      \r
66      /* Whenever we know of configuration sections that don't appear in\r
67 -- \r
68 2.7.0.rc3\r
69 \r