From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] commit.c: use strchrnul() to scan for one line
Date: Mon, 16 May 2016 08:12:33 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1605160810020.3303@virtualbox> (raw)
In-Reply-To: <xmqq37pj55bg.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Sun, 15 May 2016, Junio C Hamano wrote:
> diff --git a/commit.c b/commit.c
> index 3f4f371..1f9ee8a 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -415,8 +415,7 @@ int find_commit_subject(const char *commit_buffer, const char **subject)
> p++;
> if (*p) {
> p += 2;
> - for (eol = p; *eol && *eol != '\n'; eol++)
> - ; /* do nothing */
> + eol = strchrnul(p, '\n');
> } else
> eol = p;
ACK. This was my fault, when I introduced the code in 9509af68 (Make
git-revert & git-cherry-pick a builtin, 2007-03-01). To be fair,
strchrnul() was introduced only later, in 659c69c (Add strchrnul(),
2007-11-09).
Ciao,
Dscho
next prev parent reply other threads:[~2016-05-16 6:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-15 22:23 [PATCH] commit.c: use strchrnul() to scan for one line Junio C Hamano
2016-05-16 6:12 ` Johannes Schindelin [this message]
2016-05-16 15:57 ` Junio C Hamano
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=alpine.DEB.2.20.1605160810020.3303@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).