Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / c9 / 353b3886f193f9b7c0391283222095a297d3e8
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 arlo.cworth.org (Postfix) with ESMTP id 6D3626DE028C\r
6  for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:26 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.563\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.563 tagged_above=-999 required=5 tests=[AWL=0.157,\r
13   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
14  RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id NyIsEA5Iqzqt for <notmuch@notmuchmail.org>;\r
18  Sat, 18 Jun 2016 14:33:18 -0700 (PDT)\r
19 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
20  [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id CE26A6DE02D1 for\r
21  <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:06 -0700 (PDT)\r
22 Received: by mail-wm0-f67.google.com with SMTP id r201so5510080wme.0\r
23  for <notmuch@notmuchmail.org>; Sat, 18 Jun 2016 14:33:06 -0700 (PDT)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25  d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
26  h=from:to:cc:subject:date:message-id:in-reply-to:references\r
27  :in-reply-to:references;\r
28  bh=pYUqjKEAM2QcAMxPIpXQWiHvzp0ChQDW96w9W+kxwCw=;\r
29  b=RasAI0nmLk1MCB9A5xji8+gJRppTliIHrck9AkmpNnfEYnlnxLfE4jnBS49vdR9i8R\r
30  X0CwKqtzZh4FaD1Ver0rdxtHfnSRc4fSi0IGDIBYIJPkSXXxgViIQMrrunXuLtRgYjA2\r
31  vVQiGOWpm+BDScdAE/KGFYARYhMvXjQKxI8btB+IorzHI5GgjacaDlsfT84pNbXLnEU4\r
32  yeK60yOC6a5jPNCflDCZ9YOwBk4fU8in3+/2w9WOPFabFvyOglKPmH6re2pce/MYGF2Y\r
33  ZtrmFii3gzkP8HTOs/522LbO9NbC5twlD+Dd0n4VtdGkxHvCGEx+EtwWVRyhUBbTGBXI\r
34  JBqg==\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
36  d=1e100.net; s=20130820;\r
37  h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
38  :references:in-reply-to:references;\r
39  bh=pYUqjKEAM2QcAMxPIpXQWiHvzp0ChQDW96w9W+kxwCw=;\r
40  b=YtPrJgcRry6JnH7ZTEb/0LXbBRdGL9AoRUqJWeTYHN83m/VlAl3wawkDZo840lHdSp\r
41  HkzLwGaLPbNB+BwqfpEZImAVtodo6y3j79CG54xN35dAjLsSqoL16NJ+e5MibFFoCStL\r
42  vGDStW928IaArnj+P+uuysY3Z4tKzQUCPtYWWZbNWzvUt7yxJwTSHMZV8MQ0+Lp+YAlx\r
43  TO7eDNukqdMt5YSbG8573HwVvWibEBFyVBteDjk5mHyLA0/9g5fP/XFfFPUtFDHRpKE7\r
44  PPJ1wPxMtrCWO+eU350CowhnNa8aVzIKNbHQYrShvU/rq4wi3+PllqSvlIsPBwxviFh0\r
45  pkJQ==\r
46 X-Gm-Message-State:\r
47  ALyK8tIBmFHNXO3BoxpR6e4HKo8GhBITPhxzEtQISjYRMmZ45n5QKbGHgi03qLOTgq+GvA==\r
48 X-Received: by 10.194.237.33 with SMTP id uz1mr7637646wjc.5.1466285585445;\r
49  Sat, 18 Jun 2016 14:33:05 -0700 (PDT)\r
50 Received: from localhost (mobile-access-bcee4e-81.dhcp.inet.fi.\r
51  [188.238.78.81])\r
52  by smtp.gmail.com with ESMTPSA id o10sm18783341wjs.38.2016.06.18.14.33.04\r
53  (version=TLSv1/SSLv3 cipher=OTHER);\r
54  Sat, 18 Jun 2016 14:33:04 -0700 (PDT)\r
55 From: Jani Nikula <jani@nikula.org>\r
56 To: notmuch@notmuchmail.org\r
57 Cc: jani@nikula.org,\r
58         Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
59 Subject: [PATCH 5/7] cli/reply: make references header creation easier to\r
60  follow\r
61 Date: Sun, 19 Jun 2016 00:31:31 +0300\r
62 Message-Id:\r
63  <b538845ba9a38be49292fe53d6de21e7000122b3.1466284726.git.jani@nikula.org>\r
64 X-Mailer: git-send-email 2.1.4\r
65 In-Reply-To: <cover.1466284726.git.jani@nikula.org>\r
66 References: <cover.1466284726.git.jani@nikula.org>\r
67 In-Reply-To: <cover.1466284726.git.jani@nikula.org>\r
68 References: <cover.1466284726.git.jani@nikula.org>\r
69 X-BeenThere: notmuch@notmuchmail.org\r
70 X-Mailman-Version: 2.1.20\r
71 Precedence: list\r
72 List-Id: "Use and development of the notmuch mail system."\r
73  <notmuch.notmuchmail.org>\r
74 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
75  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
76 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
77 List-Post: <mailto:notmuch@notmuchmail.org>\r
78 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
79 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
80  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
81 X-List-Received-Date: Sat, 18 Jun 2016 21:33:26 -0000\r
82 \r
83 Just use strdup when original references is not available, instead of\r
84 trying to cram everything into a monster asprintf. There should be no\r
85 functional changes.\r
86 ---\r
87  notmuch-reply.c | 13 ++++++-------\r
88  1 file changed, 6 insertions(+), 7 deletions(-)\r
89 \r
90 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
91 index eb07405591fd..c2d7402d40ae 100644\r
92 --- a/notmuch-reply.c\r
93 +++ b/notmuch-reply.c\r
94 @@ -538,13 +538,12 @@ create_reply_message(void *ctx,\r
95      g_mime_object_set_header (GMIME_OBJECT (reply), "In-Reply-To", in_reply_to);\r
96  \r
97      orig_references = notmuch_message_get_header (message, "references");\r
98 -    if (!orig_references)\r
99 -       /* Treat errors like missing References headers. */\r
100 -       orig_references = "";\r
101 -    references = talloc_asprintf (ctx, "%s%s%s",\r
102 -                                 *orig_references ? orig_references : "",\r
103 -                                 *orig_references ? " " : "",\r
104 -                                 in_reply_to);\r
105 +    if (orig_references && *orig_references)\r
106 +       references = talloc_asprintf (ctx, "%s %s", orig_references,\r
107 +                                     in_reply_to);\r
108 +    else\r
109 +       references = talloc_strdup (ctx, in_reply_to);\r
110 +\r
111      g_mime_object_set_header (GMIME_OBJECT (reply), "References", references);\r
112  \r
113      from_addr = add_recipients_from_message (reply, config,\r
114 -- \r
115 2.1.4\r
116 \r