From: Junio C Hamano <gitster@pobox•com>
To: Christian Couder <chriscool@tuxfamily•org>
Cc: git@vger•kernel.org, Johan Herland <johan@herland•net>,
Josh Triplett <josh@joshtriplett•org>,
Thomas Rast <tr@thomasrast•ch>,
Michael Haggerty <mhagger@alum•mit.edu>,
Dan Carpenter <dan.carpenter@oracle•com>,
Greg Kroah-Hartman <greg@kroah•com>, Jeff King <peff@peff•net>,
Eric Sunshine <sunshine@sunshineco•com>,
Ramsay Jones <ramsay@ramsay1•demon.co.uk>,
Jonathan Nieder <jrnieder@gmail•com>,
Marc Branchaud <marcnarc@xiplink•com>
Subject: Re: [PATCH v14 01/11] trailer: add data structures and basic functions
Date: Mon, 15 Sep 2014 13:39:25 -0700 [thread overview]
Message-ID: <xmqqsijs4o02.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140915053142.26573.86374.chriscool@tuxfamily.org> (Christian Couder's message of "Mon, 15 Sep 2014 07:31:31 +0200")
Christian Couder <chriscool@tuxfamily•org> writes:
> +/* Get the length of buf from its beginning until its last alphanumeric character */
That makes it sound as if feeding "abc%de#f@" to the function returns
3 for "abc", but
> +static size_t alnum_len(const char *buf, size_t len)
> +{
> + while (len > 0 && !isalnum(buf[len - 1]))
> + len--;
> + return len;
> +}
doesn't it look at '@', be unhappy and decrement, look at 'f' and
break out to return the length of "abc%de#f"?
Perhaps that behaviour _is_ what you want, but then the comment is
lying, no?
next prev parent reply other threads:[~2014-09-15 20:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 5:31 [PATCH v14 00/11] Add interpret-trailers builtin Christian Couder
2014-09-15 5:31 ` [PATCH v14 01/11] trailer: add data structures and basic functions Christian Couder
2014-09-15 20:39 ` Junio C Hamano [this message]
2014-09-16 8:01 ` Christian Couder
2014-09-17 7:58 ` Jeff King
2014-09-17 8:26 ` Christian Couder
2014-09-15 5:31 ` [PATCH v14 02/11] trailer: process trailers from input message and arguments Christian Couder
2014-09-15 5:31 ` [PATCH v14 03/11] trailer: read and process config information Christian Couder
2014-09-15 5:31 ` [PATCH v14 04/11] trailer: process command line trailer arguments Christian Couder
2014-09-15 5:31 ` [PATCH v14 05/11] trailer: parse trailers from file or stdin Christian Couder
2014-09-15 5:31 ` [PATCH v14 06/11] trailer: put all the processing together and print Christian Couder
2014-09-15 5:31 ` [PATCH v14 07/11] trailer: add interpret-trailers command Christian Couder
2014-09-15 5:31 ` [PATCH v14 08/11] trailer: add tests for "git interpret-trailers" Christian Couder
2014-09-15 5:31 ` [PATCH v14 09/11] trailer: execute command from 'trailer.<name>.command' Christian Couder
2014-09-15 5:31 ` [PATCH v14 10/11] trailer: add tests for commands in config file Christian Couder
2014-09-15 5:31 ` [PATCH v14 11/11] Documentation: add documentation for 'git interpret-trailers' Christian Couder
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=xmqqsijs4o02.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=chriscool@tuxfamily$(echo .)org \
--cc=dan.carpenter@oracle$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=greg@kroah$(echo .)com \
--cc=johan@herland$(echo .)net \
--cc=josh@joshtriplett$(echo .)org \
--cc=jrnieder@gmail$(echo .)com \
--cc=marcnarc@xiplink$(echo .)com \
--cc=mhagger@alum$(echo .)mit.edu \
--cc=peff@peff$(echo .)net \
--cc=ramsay@ramsay1$(echo .)demon.co.uk \
--cc=sunshine@sunshineco$(echo .)com \
--cc=tr@thomasrast$(echo .)ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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