summaryrefslogtreecommitdiff
path: root/src/ignore.c
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-02-27 04:28:31 +0100
committerVicent Martí <tanoku@gmail.com>2012-02-27 05:30:07 +0100
commit13224ea4aad9a1b3c9cc4c992ceaea9af623e047 (patch)
treeb5c3a503d1ef7ba6269bf4291530c4e8e5936bdb /src/ignore.c
parente07c2d225deec42e592133df49ad8c564d4d66c7 (diff)
downloadlibgit2-13224ea4aad9a1b3c9cc4c992ceaea9af623e047.tar.gz
buffer: Unify `git_fbuffer` and `git_buf`
This makes so much sense that I can't believe it hasn't been done before. Kill the old `git_fbuffer` and read files straight into `git_buf` objects. Also: In order to fully support 4GB files in 32-bit systems, the `git_buf` implementation has been changed from using `ssize_t` for storage and storing negative values on allocation failure, to using `size_t` and changing the buffer pointer to a magical pointer on allocation failure. Hopefully this won't break anything.
Diffstat (limited to 'src/ignore.c')
-rw-r--r--src/ignore.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ignore.c b/src/ignore.c
index 30f86b822..a3bf0a282 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -11,7 +11,7 @@ static int load_ignore_file(
git_repository *repo, const char *path, git_attr_file *ignores)
{
int error = GIT_SUCCESS;
- git_fbuffer fbuf = GIT_FBUFFER_INIT;
+ git_buf fbuf = GIT_BUF_INIT;
git_attr_fnmatch *match = NULL;
const char *scan = NULL;
char *context = NULL;
@@ -28,7 +28,7 @@ static int load_ignore_file(
if (error == GIT_SUCCESS)
error = git_futils_readbuffer(&fbuf, path);
- scan = fbuf.data;
+ scan = fbuf.ptr;
while (error == GIT_SUCCESS && *scan) {
if (!match && !(match = git__calloc(1, sizeof(git_attr_fnmatch)))) {
@@ -53,7 +53,7 @@ static int load_ignore_file(
}
}
- git_futils_freebuffer(&fbuf);
+ git_buf_free(&fbuf);
git__free(match);
git__free(context);