From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] commit: use strbuf_add() to add a length-limited string
Date: Mon, 09 Dec 2019 11:24:33 -0800 [thread overview]
Message-ID: <xmqqh829uwsu.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <f4c7d65f-d7bb-c574-fe48-8d2df0c2907a@web.de> ("René Scharfe"'s message of "Sat, 7 Dec 2019 12:16:04 +0100")
René Scharfe <l.s.r@web.de> writes:
> This is shorter and simpler.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
Ack (this was from me abck in 2012).
> builtin/commit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 294dc574cd..35a1fb9ad6 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -537,7 +537,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
> struct strbuf buf = STRBUF_INIT;
> if (hack)
> strbuf_addch(&buf, hack);
> - strbuf_addf(&buf, "%.*s", (int)(e - s), s);
> + strbuf_add(&buf, s, e - s);
> setenv(var, buf.buf, 1);
> strbuf_release(&buf);
> }
> --
> 2.24.0
prev parent reply other threads:[~2019-12-09 19:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-07 11:16 [PATCH] commit: use strbuf_add() to add a length-limited string René Scharfe
2019-12-07 20:17 ` Derrick Stolee
2019-12-09 19:24 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh829uwsu.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
/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.
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 NNTP newsgroup(s).