[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / b1 / 966830176e31a8446e56cc5991d9c39fb4cf91
1 Return-Path: <jani@nikula.org>\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 2E138431FAF\r
6         for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:41:18 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 JzGigM5Zzgo6 for <notmuch@notmuchmail.org>;\r
16         Sun, 16 Dec 2012 14:41:17 -0800 (PST)\r
17 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
18         [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 40723431FAE\r
21         for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:41:17 -0800 (PST)\r
22 Received: by mail-lb0-f181.google.com with SMTP id ge1so4083048lbb.26\r
23         for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:41:15 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type:x-gm-message-state;\r
28         bh=cqaFOzs62Te1J0RpDPkl6NQStKZTCgly1GYCqm/9AMQ=;\r
29         b=HJETT2P+6f+L0VKblXINRJyn7Yrett/KjUYEYZUZ0qp/Npx8wn/B4l8CnQsHD7PySP\r
30         bKw/GhEyIo/Uyzi38eRaESPPW58FgixubO/ViPufskPNjRJY64OoWvtKuFtq1KrsUFIB\r
31         w3kSXDRuBGXQ3A7F71EHMQbZMFkkl9Lhc8TjJdLqUhGq3hDzcPsUiN7cQq5ti4K3EC3C\r
32         yMXoOBTwGEmOCzcmDo+w3gODVfToIq5RwQAlLRwR/Aqa4QOP/TDa5YvG6D8rcNNkt7TD\r
33         KY4YI9KPfAqfAwHZHMmp37iii4EvEXCVFMmgszJoRNUUDz9EyoZWaDySgUtOKK0WzLRg\r
34         oeiw==\r
35 Received: by 10.112.83.100 with SMTP id p4mr5048275lby.96.1355697675705;\r
36         Sun, 16 Dec 2012 14:41:15 -0800 (PST)\r
37 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
38         [80.223.81.27])\r
39         by mx.google.com with ESMTPS id ne2sm4136684lab.10.2012.12.16.14.41.13\r
40         (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 14:41:14 -0800 (PST)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: david@tethera.net, notmuch@notmuchmail.org\r
43 Subject: Re: [PATCH 3/3] notmuch-restore: allocate a temporary talloc context\r
44         for each line parsed.\r
45 In-Reply-To: <1355688997-19164-4-git-send-email-david@tethera.net>\r
46 References: <1355688997-19164-1-git-send-email-david@tethera.net>\r
47         <1355688997-19164-4-git-send-email-david@tethera.net>\r
48 User-Agent: Notmuch/0.14+138~g7041c56 (http://notmuchmail.org) Emacs/23.4.1\r
49         (i686-pc-linux-gnu)\r
50 Date: Mon, 17 Dec 2012 00:41:12 +0200\r
51 Message-ID: <87ip81pqlz.fsf@nikula.org>\r
52 MIME-Version: 1.0\r
53 Content-Type: text/plain; charset=us-ascii\r
54 X-Gm-Message-State:\r
55  ALoCoQmY0f2V6oBOtXX0PPWxxSqtiNu9/NXE8l70UadLGl939ySkZwfwbeIzsj/OC9XZ7gYAux8Z\r
56 Cc: David Bremner <bremner@debian.org>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sun, 16 Dec 2012 22:41:18 -0000\r
70 \r
71 On Sun, 16 Dec 2012, david@tethera.net wrote:\r
72 > From: David Bremner <bremner@debian.org>\r
73 >\r
74 > This lets the high level code in notmuch restore be ignorant about\r
75 > what the lower level code is doing as far as allocating memory.\r
76 > ---\r
77 >  notmuch-restore.c |   12 ++++++++++--\r
78 >  1 file changed, 10 insertions(+), 2 deletions(-)\r
79 >\r
80 > diff --git a/notmuch-restore.c b/notmuch-restore.c\r
81 > index 4b76d83..52e7ecb 100644\r
82 > --- a/notmuch-restore.c\r
83 > +++ b/notmuch-restore.c\r
84 > @@ -122,6 +122,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])\r
85 >      char *input_file_name = NULL;\r
86 >      FILE *input = stdin;\r
87 >      char *line = NULL;\r
88 > +    void *line_ctx = NULL;\r
89 >      size_t line_size;\r
90 >      ssize_t line_len;\r
91 >  \r
92 > @@ -205,10 +206,11 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])\r
93 >      do {\r
94 >       char *query_string;\r
95 \r
96 This patch only works on top of the batch tagging series, because\r
97 there's still one continue statement in the "id:" prefix check. But you\r
98 could make it work for both, *and* keep the slightly more intuitive ret\r
99 checking order if you did (yes, the slightly counter-intuitive):\r
100 \r
101         if (line_ctxt != NULL)\r
102           talloc_free (line_ctx);\r
103 \r
104 right here, and...\r
105 \r
106 > +     line_ctx = talloc_new (ctx);\r
107 >       if (input_format == DUMP_FORMAT_SUP) {\r
108 > -         ret = parse_sup_line (ctx, line, &query_string, tag_ops);\r
109 > +         ret = parse_sup_line (line_ctx, line, &query_string, tag_ops);\r
110 >       } else {\r
111 > -         ret = parse_tag_line (ctx, line, TAG_FLAG_BE_GENEROUS,\r
112 > +         ret = parse_tag_line (line_ctx, line, TAG_FLAG_BE_GENEROUS,\r
113 >                                 &query_string, tag_ops);\r
114 >  \r
115 >           if (ret == 0) {\r
116 > @@ -238,8 +240,14 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])\r
117 >               break;\r
118 >       }\r
119 >  \r
120 > +     talloc_free (line_ctx);\r
121 > +     /* setting to NULL is important to avoid a double free */\r
122 > +     line_ctx = NULL;\r
123 \r
124 ...removed the above lines here.\r
125 \r
126 Otherwise I think you'll need a temporary goto until the batch tagging\r
127 series. (I'm fine with that too.)\r
128 \r
129 Overall the series LGTM, and I like how this dodges the query_string\r
130 alloc/free problem altogether.\r
131 \r
132 BR,\r
133 Jani.\r
134 \r
135 >      }  while ((line_len = getline (&line, &line_size, input)) != -1);\r
136 >  \r
137 > +    if (line_ctx != NULL)\r
138 > +     talloc_free (line_ctx);\r
139 > +\r
140 >      if (input_format == DUMP_FORMAT_SUP)\r
141 >       regfree (&regex);\r
142 >  \r
143 > -- \r
144 > 1.7.10.4\r
145 >\r
146 > _______________________________________________\r
147 > notmuch mailing list\r
148 > notmuch@notmuchmail.org\r
149 > http://notmuchmail.org/mailman/listinfo/notmuch\r