diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-06-29 15:09:21 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-29 15:09:21 +0200 |
| commit | cfef5fb779ceba60cdd04f323b88373181c0fa8d (patch) | |
| tree | 7561cc48ef1928ed7e6836454a9fba3ce753a47d /src | |
| parent | 7376ad99275fee606f298e56ac2652c203f8ebe2 (diff) | |
| download | libgit2-cfef5fb779ceba60cdd04f323b88373181c0fa8d.tar.gz | |
config: `foreach` now returns variable values too
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.c | 2 | ||||
| -rw-r--r-- | src/config_file.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c index cc31bda6d..a2202d79b 100644 --- a/src/config.c +++ b/src/config.c @@ -151,7 +151,7 @@ int git_config_add_file(git_config *cfg, git_config_file *file, int priority) * Loop over all the variables */ -int git_config_foreach(git_config *cfg, int (*fn)(const char *, void *), void *data) +int git_config_foreach(git_config *cfg, int (*fn)(const char *, const char *, void *), void *data) { int ret = GIT_SUCCESS; unsigned int i; diff --git a/src/config_file.c b/src/config_file.c index 2966f11bd..b01778739 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -310,7 +310,7 @@ static void backend_free(git_config_file *_backend) free(backend); } -static int file_foreach(git_config_file *backend, int (*fn)(const char *, void *), void *data) +static int file_foreach(git_config_file *backend, int (*fn)(const char *, const char *, void *), void *data) { int ret = GIT_SUCCESS; cvar_t *var; @@ -323,7 +323,7 @@ static int file_foreach(git_config_file *backend, int (*fn)(const char *, void * if (ret < GIT_SUCCESS) return ret; - ret = fn(normalized, data); + ret = fn(normalized, var->value, data); free(normalized); if (ret) break; |
