Re: [PATCH v3 07/11] sequencer.c: teach append_signoff how to detect duplicate s-o-b

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

 



On Sun, Jan 27, 2013 at 7:14 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Brandon Casey wrote:
>
>> --- a/sequencer.c
>> +++ b/sequencer.c
> [...]
>> @@ -1096,10 +1117,16 @@ void append_signoff(struct strbuf *msgbuf, int ignore_footer)
>>       strbuf_addch(&sob, '\n');
>>       for (i = msgbuf->len - 1 - ignore_footer; i > 0 && msgbuf->buf[i - 1] != '\n'; i--)
>>               ; /* do nothing */
>> -     if (prefixcmp(msgbuf->buf + i, sob.buf)) {
>> -             if (!i || !has_conforming_footer(msgbuf, ignore_footer))
>> -                     strbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0, "\n", 1);
>> -             strbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0, sob.buf, sob.len);
>> -     }
>> +
>> +     if (i)
>> +             has_footer = has_conforming_footer(msgbuf, &sob, ignore_footer);
>
> Is this "if (i)" test needed?  I'd expect that if the message has no newlines,
> has_conforming_footer() would notice that and return 0.

Thanks for pointing out this awkwardness.  It should be pushed into
has_conforming_footer().

-Brandon
--
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]