Re: [PATCH] [PATCH] commit.c: Replace starts_with() with skip_prefix()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 4, 2014 at 5:27 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Tue, Mar 4, 2014 at 10:54 AM, Karthik Nayak <karthik.188@xxxxxxxxx> 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;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]