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

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v4 [diff vs current]

[PATCH 05/17] mktree: read textual tree representation with strbuf_gets()

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:07:05
Subsystem: the rest · Maintainer: Linus Torvalds

The input can come from a DOS editor.

Signed-off-by: Junio C Hamano <redacted>
---
 builtin/mktree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/mktree.c b/builtin/mktree.c
index a964d6b..a55f067 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_gets(&sb, stdin)
+			     : strbuf_getline(&sb, stdin, '\0')) == EOF) {
 				got_eof = 1;
 				break;
 			}
-- 
2.6.2-423-g5314b62
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help