author | Carlos Rica <jasampler@gmail.com> | |
Wed, 18 Jul 2007 18:31:03 +0000 (20:31 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 19 Jul 2007 00:30:03 +0000 (17:30 -0700) | ||
commit | c4fba0a358d43fdb2301dd122d68c49dd8471d71 | |
tree | 72c7d505f4a8e5da3514403ca379d4b51b55a355 | tree | snapshot |
parent | 6fb73e442a7dc3e4b296b409a6f30145d85750e9 | commit | diff |
Rename read_pipe() with read_fd() and make its buffer nul-terminated.
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: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-stripspace.c | diff | blob | history | |
cache.h | diff | blob | history | |
mktag.c | diff | blob | history | |
sha1_file.c | diff | blob | history |