diff options
| author | Russell Belfer <arrbee@arrbee.com> | 2011-11-30 11:27:15 -0800 |
|---|---|---|
| committer | Russell Belfer <arrbee@arrbee.com> | 2011-12-07 23:08:15 -0800 |
| commit | 97769280ba9938ae27f6e06cbd0d5e8a768a86b9 (patch) | |
| tree | 4fe43e99acb55f904f6b586bd7c5158610f9512f /tests-clay/clay_main.c | |
| parent | a22b14d32dd8d5f06f121aa154d45bac3b10a305 (diff) | |
| download | libgit2-97769280ba9938ae27f6e06cbd0d5e8a768a86b9.tar.gz | |
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.
Diffstat (limited to 'tests-clay/clay_main.c')
| -rw-r--r-- | tests-clay/clay_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests-clay/clay_main.c b/tests-clay/clay_main.c index 409ce7643..f0ec50966 100644 --- a/tests-clay/clay_main.c +++ b/tests-clay/clay_main.c @@ -171,7 +171,8 @@ static const struct clay_func _clay_cb_core_path[] = { {"1", &test_core_path__1}, {"2", &test_core_path__2}, {"5", &test_core_path__5}, - {"6", &test_core_path__6} + {"6", &test_core_path__6}, + {"7", &test_core_path__7} }; static const struct clay_func _clay_cb_core_rmdir[] = { {"delete_recursive", &test_core_rmdir__delete_recursive}, @@ -351,7 +352,7 @@ static const struct clay_suite _clay_suites[] = { "core::path", {NULL, NULL}, {NULL, NULL}, - _clay_cb_core_path, 5 + _clay_cb_core_path, 6 }, { "core::rmdir", @@ -494,7 +495,7 @@ static const struct clay_suite _clay_suites[] = { }; static size_t _clay_suite_count = 34; -static size_t _clay_callback_count = 113; +static size_t _clay_callback_count = 114; /* Core test functions */ static void |
