Re: [PATCHv3 2/2] git-patch-id: do not trip over "no newline" markers

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

 



Michael J Gruber wrote:

> --- a/builtin/patch-id.c
> +++ b/builtin/patch-id.c
> @@ -73,6 +73,8 @@ int get_one_patchid(unsigned char *next_sha1, git_SHA_CTX *ctx)
>  			p += 7;
>  		else if (!memcmp(line, "From ", 5))
>  			p += 5;
> +		else if (!memcmp(line, "\\ ", 2) && strlen(line)>=12)
> +			continue;
>  
>  		if (!get_sha1_hex(p, next_sha1)) {
>  			found_next = 1;

All of those are minor issues:

1. Whitespace (coding style) - it should be

   +		else if (!memcmp(line, "\\ ", 2) && strlen(line) >= 12)

2. Is "\\ " needed, or "\\" would be enough (line[0] == '\')?

3. What is this 12 in "strlen(line) >= 12" about?  Note that 
   strlen(<const>) is optimized out during compiling.

-- 
Jakub Narebski
Poland
--
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]