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 171F9431E82
\r
6 for <notmuch@notmuchmail.org>; Fri, 16 Aug 2013 07:19:29 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 1pNfV3s1Gmtk for <notmuch@notmuchmail.org>;
\r
16 Fri, 16 Aug 2013 07:19:21 -0700 (PDT)
\r
17 Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com
\r
18 [209.85.214.43]) (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 A41E5431FAF
\r
21 for <notmuch@notmuchmail.org>; Fri, 16 Aug 2013 07:19:21 -0700 (PDT)
\r
22 Received: by mail-bk0-f43.google.com with SMTP id mz13so647337bkb.16
\r
23 for <notmuch@notmuchmail.org>; Fri, 16 Aug 2013 07:19:20 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references
\r
27 :user-agent:date:message-id:mime-version:content-type;
\r
28 bh=hY16oIruLu+VjIeOowyZzU7p588cbxV4sV7KgckgtGc=;
\r
29 b=TOT8Scc1HPoeqfuv3RY8IX66fjY09M8l4hyLLwoRYNMj7w8ImdhJiA8jOL21X6Vv1P
\r
30 SPnb//A1GdpLkOf6VeKa6q/mqS2S+kfZGZbWRihC9ly4E2dXBuQIGJPMxUKw6+O+IAV9
\r
31 ZWCH31LT9mjNa7N9Qv8yrXgkL5PV51Y35oC4W73MgzqZUuOWCQAs4Elo63Jp5AD7prwA
\r
32 KXmJtHhmw0+dv1bS2aS2aUYsjve0QKhggPZ8R0PSL9BR/OAtoc34AUWgJVhjqsL4+HVQ
\r
33 pibBO2DOtIB5t+oLdC5rZOyPq12TeJgq+jv8hqHZs4dO6m/Yj812cwJAAcZhAy9xD1zL
\r
36 ALoCoQmEMBC02BEZjplTjMPo6CMYtzm/YU/z6gX5gqAS/shGCIgwM5cKgocf9jGI26Ubtf63JSRu
\r
37 X-Received: by 10.204.77.72 with SMTP id f8mr920709bkk.28.1376662760251;
\r
38 Fri, 16 Aug 2013 07:19:20 -0700 (PDT)
\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
41 by mx.google.com with ESMTPSA id 14sm362700bkl.17.1969.12.31.16.00.00
\r
42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
43 Fri, 16 Aug 2013 07:19:19 -0700 (PDT)
\r
44 From: Jani Nikula <jani@nikula.org>
\r
45 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
46 Subject: Re: [PATCH v2 2/3] reply: Remove extraneous space from generated
\r
48 In-Reply-To: <1376587658-19202-3-git-send-email-amdragon@mit.edu>
\r
49 References: <1376587658-19202-1-git-send-email-amdragon@mit.edu>
\r
50 <1376587658-19202-3-git-send-email-amdragon@mit.edu>
\r
51 User-Agent: Notmuch/0.15.2+227~g40b2846 (http://notmuchmail.org) Emacs/24.3.1
\r
52 (x86_64-pc-linux-gnu)
\r
53 Date: Fri, 16 Aug 2013 17:19:25 +0300
\r
54 Message-ID: <87k3jl3ehe.fsf@nikula.org>
\r
56 Content-Type: text/plain
\r
57 Cc: tomi.ollila@iki.fi
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Fri, 16 Aug 2013 14:19:29 -0000
\r
72 On Thu, 15 Aug 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
73 > Previously, the References header code seemed to assume
\r
74 > notmuch_message_get_header would return NULL if the header was not
\r
75 > present, but it actually returns "". As a result of this, it was
\r
76 > inserting an unnecessary space when concatenating an empty or missing
\r
77 > original references header with the new reference.
\r
79 > This shows up in only two tests because the text reply format later
\r
80 > passes the whole reply template through g_mime_filter_headers, which
\r
81 > has the side effect of stripping out this extra space.
\r
83 > notmuch-reply.c | 14 ++++++++------
\r
84 > test/multipart | 2 +-
\r
86 > 3 files changed, 10 insertions(+), 8 deletions(-)
\r
88 > diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
89 > index 3b2b58d..0f3b9cd 100644
\r
90 > --- a/notmuch-reply.c
\r
91 > +++ b/notmuch-reply.c
\r
92 > @@ -537,12 +537,14 @@ create_reply_message(void *ctx,
\r
93 > "In-Reply-To", in_reply_to);
\r
95 > orig_references = notmuch_message_get_header (message, "references");
\r
96 > - references = talloc_asprintf (ctx, "%s%s%s",
\r
97 > - orig_references ? orig_references : "",
\r
98 > - orig_references ? " " : "",
\r
100 > - g_mime_object_set_header (GMIME_OBJECT (reply),
\r
101 > - "References", references);
\r
102 > + if (orig_references) {
\r
103 > + references = talloc_asprintf (ctx, "%s%s%s",
\r
104 > + *orig_references ? orig_references : "",
\r
105 > + *orig_references ? " " : "",
\r
107 > + g_mime_object_set_header (GMIME_OBJECT (reply),
\r
108 > + "References", references);
\r
111 If orig_references turned out to be NULL, wouldn't this then fail to add
\r
112 a References: header with in_reply_to in it?
\r
120 > diff --git a/test/multipart b/test/multipart
\r
121 > index c974226..2033023 100755
\r
122 > --- a/test/multipart
\r
123 > +++ b/test/multipart
\r
124 > @@ -599,7 +599,7 @@ cat <<EOF >EXPECTED
\r
125 > "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
\r
126 > "To": "Carl Worth <cworth@cworth.org>, cworth@cworth.org",
\r
127 > "In-reply-to": "<87liy5ap00.fsf@yoom.home.cworth.org>",
\r
128 > - "References": " <87liy5ap00.fsf@yoom.home.cworth.org>"},
\r
129 > + "References": "<87liy5ap00.fsf@yoom.home.cworth.org>"},
\r
130 > "original": {"id": "XXXXX",
\r
132 > "excluded": false,
\r
133 > diff --git a/test/reply b/test/reply
\r
134 > index c877ffe..a85ebe5 100755
\r
137 > @@ -242,7 +242,7 @@ test_expect_equal_json "$output" '
\r
138 > "reply-headers": {
\r
139 > "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
\r
140 > "In-reply-to": "<'${gen_msg_id}'>",
\r
141 > - "References": " <'${gen_msg_id}'>",
\r
142 > + "References": "<'${gen_msg_id}'>",
\r
143 > "Subject": "Re: \u00e0\u00df\u00e7",
\r
144 > "To": "\u2603 <snowman@example.com>"
\r
149 > _______________________________________________
\r
150 > notmuch mailing list
\r
151 > notmuch@notmuchmail.org
\r
152 > http://notmuchmail.org/mailman/listinfo/notmuch
\r