author | Jeff King <peff@peff.net> | |
Thu, 9 Jun 2011 15:54:58 +0000 (11:54 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 22 Jun 2011 18:24:51 +0000 (11:24 -0700) | ||
commit | 2f1d9e2b93e1b7fbfcfa59331db89dd6c76a3505 | |
tree | e94c085b9536fa2d196c546482b9c80dfee6fb0b | tree | snapshot |
parent | c5d6350bdc8d0d8bd4bd1aa0273313e71cd548f6 | commit | diff |
strbuf: allow strbuf_split to work on non-strbufs
The strbuf_split function takes a strbuf as input, and
outputs a list of strbufs. However, there is no reason that
the input has to be a strbuf, and not an arbitrary buffer.
This patch adds strbuf_split_buf for a length-delimited
buffer, and strbuf_split_str for NUL-terminated strings.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The strbuf_split function takes a strbuf as input, and
outputs a list of strbufs. However, there is no reason that
the input has to be a strbuf, and not an arbitrary buffer.
This patch adds strbuf_split_buf for a length-delimited
buffer, and strbuf_split_str for NUL-terminated strings.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf.c | diff | blob | history | |
strbuf.h | diff | blob | history |