From 2dac9b5637abe580e8b8ea36e00dbbf28ec99af6 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 29 Feb 2016 18:07:15 -0800 Subject: run_processes_parallel: treat output of children as byte array We do not want the output to be interrupted by a NUL byte, so we cannot use raw fputs. Introduce strbuf_write to avoid having long arguments in run-command.c. Reviewed-by: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- strbuf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 2bf90e70f..d4f2aa136 100644 --- a/strbuf.h +++ b/strbuf.h @@ -386,6 +386,12 @@ extern ssize_t strbuf_read_file(struct strbuf *sb, const char *path, size_t hint */ extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); +/** + * Write the whole content of the strbuf to the stream not stopping at + * NUL bytes. + */ +extern ssize_t strbuf_write(struct strbuf *sb, FILE *stream); + /** * Read a line from a FILE *, overwriting the existing contents * of the strbuf. The second argument specifies the line -- cgit v1.2.1