Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b9 / 01f89f79350adafe9d45fcad8ee4aa2befa86c
1 Return-Path: <too@guru-group.fi>\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 C9C9E431FAE\r
6         for <notmuch@notmuchmail.org>; Thu,  7 Aug 2014 08:20:22 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 29k-NnquOo3X for <notmuch@notmuchmail.org>;\r
16         Thu,  7 Aug 2014 08:20:18 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id D8CE9431FC2\r
19         for <notmuch@notmuchmail.org>; Thu,  7 Aug 2014 08:20:05 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id D52BE1000E0; Thu,  7 Aug 2014 18:19:52 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] notmuch-config: talloc_strdup MAILDIR and NAME environment\r
25         variables\r
26 Date: Thu,  7 Aug 2014 18:19:50 +0300\r
27 Message-Id: <1407424790-12538-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 2.0.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Thu, 07 Aug 2014 15:20:22 -0000\r
43 \r
44 When defined -- the pointer is soon given to talloc_free() which\r
45 expects it to be allocated by talloc.\r
46 ---\r
47  notmuch-config.c | 8 ++++++--\r
48  1 file changed, 6 insertions(+), 2 deletions(-)\r
49 \r
50 diff --git a/notmuch-config.c b/notmuch-config.c\r
51 index 88831e2..db487db 100644\r
52 --- a/notmuch-config.c\r
53 +++ b/notmuch-config.c\r
54 @@ -324,7 +324,9 @@ notmuch_config_open (void *ctx,\r
55  \r
56      if (notmuch_config_get_database_path (config) == NULL) {\r
57         char *path = getenv ("MAILDIR");\r
58 -       if (! path)\r
59 +       if (path)\r
60 +           path = talloc_strdup (config, path);\r
61 +       else\r
62             path = talloc_asprintf (config, "%s/mail",\r
63                                     getenv ("HOME"));\r
64         notmuch_config_set_database_path (config, path);\r
65 @@ -333,7 +335,9 @@ notmuch_config_open (void *ctx,\r
66  \r
67      if (notmuch_config_get_user_name (config) == NULL) {\r
68         char *name = getenv ("NAME");\r
69 -       if (! name)\r
70 +       if (name)\r
71 +           name = talloc_strdup (config, name);\r
72 +       else\r
73             name = get_name_from_passwd_file (config);\r
74         notmuch_config_set_user_name (config, name);\r
75         talloc_free (name);\r
76 -- \r
77 1.9.3\r
78 \r