diff options
| author | Sven Strickroth <email@cs-ware.de> | 2012-09-25 00:09:44 +0200 |
|---|---|---|
| committer | Sven Strickroth <email@cs-ware.de> | 2012-09-25 00:09:44 +0200 |
| commit | d7940ac3e4afd92fca527aafcc13a88817c5670f (patch) | |
| tree | 5a75ac7f3a6a6d1faae04301100eeaa7c4cd2050 /src/config.c | |
| parent | 407cf4e414ac2d67a27212e31d96582d4b83c8bc (diff) | |
| download | libgit2-d7940ac3e4afd92fca527aafcc13a88817c5670f.tar.gz | |
Fixed missing method
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index b3d6fc69a..e9854731b 100644 --- a/src/config.c +++ b/src/config.c @@ -483,6 +483,28 @@ int git_config_find_global(char *global_config_path, size_t length) return 0; } +int git_config_find_xdr(char *xdr_config_path, size_t length) +{ + git_buf path = GIT_BUF_INIT; + int ret = git_config_find_xdr_r(&path); + + if (ret < 0) { + git_buf_free(&path); + return ret; + } + + if (path.size >= length) { + git_buf_free(&path); + giterr_set(GITERR_NOMEMORY, + "Path is to long to fit on the given buffer"); + return -1; + } + + git_buf_copy_cstr(xdr_config_path, length, &path); + git_buf_free(&path); + return 0; +} + int git_config_find_system_r(git_buf *path) { return git_futils_find_system_file(path, GIT_CONFIG_FILENAME_SYSTEM); |
