git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()
Date: Wed, 5 Mar 2014 02:48:04 -0500	[thread overview]
Message-ID: <CAPig+cSQtQ_uvjdA2s3+K8YQLDuMXqqc-jG2AuSM7K52q3_pPQ@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cR=9oonOdyOm3y2NpdLxh-sq5qQtSxmmN2dH7+UzRy-gA@mail.gmail.com>

On Tue, Mar 4, 2014 at 5:27 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Tue, Mar 4, 2014 at 10:54 AM, Karthik Nayak <karthik.188@gmail.com> wrote:
>> diff --git a/commit.c b/commit.c
>> index 6bf4fe0..71a03e3 100644
>> --- a/commit.c
>> +++ b/commit.c
>> @@ -1111,11 +1114,11 @@ int parse_signed_commit(const unsigned char *sha1,
>>                 char *next = memchr(line, '\n', tail - line);
>>
>>                 next = next ? next + 1 : tail;
>> +               indent_line = skip_prefix(line, gpg_sig_header);
>
> Even stranger variable name for a GPG signature (which has nothing at
> all to do with indentation).
>
>>                 if (in_signature && line[0] == ' ')
>>                         sig = line + 1;
>> -               else if (starts_with(line, gpg_sig_header) &&
>> -                        line[gpg_sig_header_len] == ' ')
>> -                       sig = line + gpg_sig_header_len + 1;
>> +               else if (indent_line && indent_line[1] == ' ')

Also, shouldn't this be checking *indent_line (or indent_line[0])
rather than indent_line[1]?

>> +                       sig = indent_line + 2;
>
> Why is this adding 2 rather than 1?
>
>>                 if (sig) {
>>                         strbuf_add(signature, sig, next - sig);
>>                         saw_signature = 1;

      parent reply	other threads:[~2014-03-05  7:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 15:54 [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix() Karthik Nayak
2014-03-04 17:31 ` Tanay Abhra
2014-03-04 17:58   ` karthik nayak
2014-03-04 22:30     ` Eric Sunshine
2014-03-04 22:27 ` Eric Sunshine
2014-03-04 22:43   ` Eric Sunshine
2014-03-05  7:48   ` Eric Sunshine [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=CAPig+cSQtQ_uvjdA2s3+K8YQLDuMXqqc-jG2AuSM7K52q3_pPQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.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).