Thread (98 messages) flat view 98 messages, 5 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 23:07:45

On Wed, Jan 13, 2016 at 07:03:04PM -0800, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help