aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorCarlos Rica <jasampler@gmail.com>2007-07-18 20:31:03 +0200
committerJunio C Hamano <gitster@pobox.com>2007-07-18 17:30:03 -0700
commitc4fba0a358d43fdb2301dd122d68c49dd8471d71 (patch)
tree72c7d505f4a8e5da3514403ca379d4b51b55a355 /cache.h
parent6fb73e442a7dc3e4b296b409a6f30145d85750e9 (diff)
downloadgit-c4fba0a358d43fdb2301dd122d68c49dd8471d71.tar.gz
git-c4fba0a358d43fdb2301dd122d68c49dd8471d71.tar.xz
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>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 328c1ad41..53801b808 100644
--- a/cache.h
+++ b/cache.h
@@ -265,7 +265,7 @@ extern int ie_match_stat(struct index_state *, struct cache_entry *, struct stat
extern int ie_modified(struct index_state *, struct cache_entry *, struct stat *, int);
extern int ce_path_match(const struct cache_entry *ce, const char **pathspec);
extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path);
-extern int read_pipe(int fd, char** return_buf, unsigned long* return_size);
+extern int read_fd(int fd, char **return_buf, unsigned long *return_size);
extern int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object);
extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object);
extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);