unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Subject: Re: [PATCH v2 06/14] cli/reply: make references header creation easier to follow
Date: Sat, 10 Sep 2016 13:23:42 -0300	[thread overview]
Message-ID: <874m5n206p.fsf@zancas.localnet> (raw)
In-Reply-To: <3489bb6606aa6a3fa6d9fc2e9c473c01a7d997eb.1471088022.git.jani@nikula.org>

Jani Nikula <jani@nikula.org> writes:

> Just use strdup when original references is not available, instead of
> trying to cram everything into a monster asprintf. There should be no
> functional changes.
> ---
>  notmuch-reply.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/notmuch-reply.c b/notmuch-reply.c
> index eb07405591fd..c2d7402d40ae 100644
> --- a/notmuch-reply.c
> +++ b/notmuch-reply.c
> @@ -538,13 +538,12 @@ create_reply_message(void *ctx,
>      g_mime_object_set_header (GMIME_OBJECT (reply), "In-Reply-To", in_reply_to);
>  
>      orig_references = notmuch_message_get_header (message, "references");
> -    if (!orig_references)
> -	/* Treat errors like missing References headers. */
> -	orig_references = "";
> -    references = talloc_asprintf (ctx, "%s%s%s",
> -				  *orig_references ? orig_references : "",
> -				  *orig_references ? " " : "",
> -				  in_reply_to);
> +    if (orig_references && *orig_references)
> +	references = talloc_asprintf (ctx, "%s %s", orig_references,
> +				      in_reply_to);
> +    else
> +	references = talloc_strdup (ctx, in_reply_to);
> +

fine, and probably applicable earlier if the series stalls.

d

  reply	other threads:[~2016-09-10 16:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13 11:37 [PATCH v2 00/14] reply refactor, fixes Jani Nikula
2016-08-13 11:37 ` [PATCH v2 01/14] test: add known broken test for reply to message with multiple Cc headers Jani Nikula
2016-09-10  0:43   ` David Bremner
2016-09-10 22:17   ` David Bremner
2016-09-11 11:49     ` Jani Nikula
2016-08-13 11:37 ` [PATCH v2 02/14] cli/reply: push notmuch reply format abstraction lower in the stack Jani Nikula
2016-09-10  0:53   ` David Bremner
2016-09-10  6:20     ` Jani Nikula
2016-08-13 11:37 ` [PATCH v2 03/14] cli/reply: reuse show_reply_headers() in headers-only format Jani Nikula
2016-08-13 11:37 ` [PATCH v2 04/14] cli/reply: unify reply format functions Jani Nikula
2016-09-10  1:38   ` David Bremner
2016-09-10  6:26     ` Jani Nikula
2016-08-13 11:37 ` [PATCH v2 05/14] cli/reply: reorganize create_reply_message() Jani Nikula
2016-09-10 16:21   ` David Bremner
2016-08-13 11:37 ` [PATCH v2 06/14] cli/reply: make references header creation easier to follow Jani Nikula
2016-09-10 16:23   ` David Bremner [this message]
2016-08-13 11:37 ` [PATCH v2 07/14] cli/reply: reuse create_reply_message() also for headers-only format Jani Nikula
2016-08-13 11:37 ` [PATCH v2 08/14] cli/reply: reduce the reply format abstractions Jani Nikula
2016-09-10 16:33   ` David Bremner
2016-08-13 11:37 ` [PATCH v2 09/14] cli/reply: use dedicated functions for reply to mapping Jani Nikula
2016-08-13 11:37 ` [PATCH v2 10/14] cli/reply: check for NULL list first in scan_address_list() Jani Nikula
2016-08-13 11:37 ` [PATCH v2 11/14] cli/reply: return internet address list from get header funcs Jani Nikula
2016-09-10 22:46   ` David Bremner
2016-08-13 11:37 ` [PATCH v2 12/14] cli/reply: pass internet address list to munge detect Jani Nikula
2016-09-10 22:51   ` David Bremner
2016-08-13 11:37 ` [PATCH v2 13/14] cli/reply: pass gmime message to munge detection Jani Nikula
2016-09-10 22:58   ` David Bremner
2016-08-13 11:37 ` [PATCH v2 14/14] cli/reply: only pass gmime message to add recipients to reply message Jani Nikula
2016-09-10 23:00   ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874m5n206p.fsf@zancas.localnet \
    --to=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).