• C
    Rename read_pipe() with read_fd() and make its buffer nul-terminated. · c4fba0a3
    Carlos Rica 提交于
    The new name is closer to the purpose of the function.
    
    A NUL-terminated buffer makes things easier when callers need that.
    Since the function returns only the memory written with data,
    almost always allocating more space than needed because final
    size is unknown, an extra NUL terminating the buffer is harmless.
    It is not included in the returned size, so the function
    remains working as before.
    
    Also, now the function allows the buffer passed to be NULL at first,
    and alloc_nr is now used for growing the buffer, instead size=*2.
    Signed-off-by: NCarlos Rica <jasampler@gmail.com>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    c4fba0a3
cache.h 20.8 KB