]> git.proxmox.com Git - libgit2.git/commit - src/signature.c
Use git_buf for path storage instead of stack-based buffers
authorRussell Belfer <arrbee@arrbee.com>
Wed, 30 Nov 2011 19:27:15 +0000 (11:27 -0800)
committerRussell Belfer <arrbee@arrbee.com>
Thu, 8 Dec 2011 07:08:15 +0000 (23:08 -0800)
commit97769280ba9938ae27f6e06cbd0d5e8a768a86b9
tree4fe43e99acb55f904f6b586bd7c5158610f9512f
parenta22b14d32dd8d5f06f121aa154d45bac3b10a305
Use git_buf for path storage instead of stack-based buffers

This converts virtually all of the places that allocate GIT_PATH_MAX
buffers on the stack for manipulating paths to use git_buf objects
instead.  The patch is pretty careful not to touch the public API
for libgit2, so there are a few places that still use GIT_PATH_MAX.

This extends and changes some details of the git_buf implementation
to add a couple of extra functions and to make error handling easier.

This includes serious alterations to all the path.c functions, and
several of the fileops.c ones, too.  Also, there are a number of new
functions that parallel existing ones except that use a git_buf
instead of a stack-based buffer (such as git_config_find_global_r
that exists alongsize git_config_find_global).

This also modifies the win32 version of p_realpath to allocate whatever
buffer size is needed to accommodate the realpath instead of hardcoding
a GIT_PATH_MAX limit, but that change needs to be tested still.
47 files changed:
src/blob.c
src/buffer.c
src/buffer.h
src/commit.c
src/config.c
src/config.h
src/fetch.c
src/filebuf.c
src/fileops.c
src/fileops.h
src/index.c
src/indexer.c
src/odb.c
src/odb_loose.c
src/odb_pack.c
src/path.c
src/path.h
src/pkt.c
src/posix.c
src/reflog.c
src/refs.c
src/refspec.c
src/refspec.h
src/remote.c
src/repository.c
src/signature.c
src/status.c
src/tag.c
src/transports/git.c
src/transports/http.c
src/tree.c
src/win32/posix_w32.c
tests-clay/clay.h
tests-clay/clay_libgit2.h
tests-clay/clay_main.c
tests-clay/core/buffer.c
tests-clay/core/dirent.c
tests-clay/core/path.c
tests-clay/core/rmdir.c
tests-clay/repo/init.c
tests-clay/repo/open.c
tests/t00-core.c
tests/t10-refs.c
tests/t12-repo.c
tests/t18-status.c
tests/test_helpers.c
tests/test_helpers.h