Re: [PREVIEW v3 4/9] mktree: there are only two line terminators

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

 



On Wed, Jan 13, 2016 at 07:03:04PM -0800, Junio C Hamano wrote:

> @@ -141,23 +141,25 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
>  {
>  	struct strbuf sb = STRBUF_INIT;
>  	unsigned char sha1[20];
> -	int line_termination = '\n';
> +	int lf_lines = 1;
>  	int allow_missing = 0;
>  	int is_batch_mode = 0;
>  	int got_eof = 0;
> +	strbuf_getline_fn getline_fn;
>  
>  	const struct option option[] = {
> -		OPT_SET_INT('z', NULL, &line_termination, N_("input is NUL terminated"), '\0'),
> +		OPT_SET_INT('z', NULL, &lf_lines, N_("input is NUL terminated"), '\0'),

Using '\0' isn't wrong here, but should it now just be "0", since it's
no longer meant to be a "char"?

Also, I notice that other patches in the series flip the logic (instead
of "lf_lines", we get its inverse, "nul_term_line"). That lets us use
the more obvious "OPT_BOOL" here.

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