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

Re: [PATCH v2 05/17] mktree: read textual tree representation with strbuf_getline_crlf()

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:07:37

Hi Junio,

On Wed, 16 Dec 2015, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
diff --git a/builtin/mktree.c b/builtin/mktree.c
index a964d6b..c6cafb6 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -157,7 +157,9 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
 
 	while (!got_eof) {
 		while (1) {
-			if (strbuf_getline(&sb, stdin, line_termination) == EOF) {
+			if ((line_termination
+			     ? strbuf_getline_crlf(&sb, stdin)
+			     : strbuf_getline(&sb, stdin, '\0')) == EOF) {
 				got_eof = 1;
 				break;
 			}
Here also, I would recommend to change the logic to talk about
nul_delimited instead of line_termination first, and only then introduce
the change to call two different strbuf_* functions.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help