summaryrefslogtreecommitdiff
path: root/strbuf.h
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-03-01 02:07:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-01 19:57:19 (GMT)
commit2dac9b5637abe580e8b8ea36e00dbbf28ec99af6 (patch)
tree57b46bdae2fad445c5d06538e7bae6b4de59f16c /strbuf.h
parent8c6b5491182510f2344dae71784fcb5c3992d005 (diff)
downloadgit-2dac9b5637abe580e8b8ea36e00dbbf28ec99af6.zip
git-2dac9b5637abe580e8b8ea36e00dbbf28ec99af6.tar.gz
git-2dac9b5637abe580e8b8ea36e00dbbf28ec99af6.tar.bz2
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 <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/strbuf.h b/strbuf.h
index 2bf90e7..d4f2aa1 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -387,6 +387,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
* terminator character, typically `'\n'`.