Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

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

 



Han-Wen Nienhuys <hanwen@xxxxxxxxxx> writes:

>> @@ -84,6 +86,9 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
>>         for (i = 0; i < ARRAY_SIZE(keywords); i++) {
>>                 struct keyword_entry *p = keywords + i;
>>                 int len = strlen(p->keyword);
>> +
>> +               if (n <= len)
>> +                       continue;
>
> I would suggest
>
>  if (n < len) continue;
> ..
> if (!strncasecmp(p->keyword, src, len) && (n == len || !isalnum(src[len]))) {
>
> so we colorize a single line that looks like "warning" as well

That's the kind of thing I would have mentioned in the initial
review of the feature, and I do not think it is a bad idea.

I do think it is a bad idea to roll it into this patch, though.





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

  Powered by Linux