• J
    strbuf_split: add a max parameter · 28fc3a68
    Jeff King 提交于
    Sometimes when splitting, you only want a limited number of
    fields, and for the final field to contain "everything
    else", even if it includes the delimiter.
    
    This patch introduces strbuf_split_max, which provides a
    "max number of fields" parameter; it behaves similarly to
    perl's "split" with a 3rd field.
    
    The existing 2-argument form of strbuf_split is retained for
    compatibility and ease-of-use.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    28fc3a68
strbuf.c 7.9 KB