diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-06-18 01:12:58 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-18 01:12:58 +0200 |
| commit | dbe70bd5c3f803dbcb9fe4880df11cf08093b120 (patch) | |
| tree | 934ee8be383e54cb19e87d73ac66e4e65215d5f7 /src/config.c | |
| parent | 40070445538ba6ede8dfef36e0a9824f71b33a06 (diff) | |
| download | libgit2-dbe70bd5c3f803dbcb9fe4880df11cf08093b120.tar.gz | |
config: Fix compilation in MSVC
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c index 2b2bdb070..b802ba50b 100644 --- a/src/config.c +++ b/src/config.c @@ -303,7 +303,8 @@ int git_config_get_string(git_config *cfg, const char *name, const char **out) { file_internal *internal; git_config_file *file; - int i, error; + int error = GIT_ENOTFOUND; + unsigned int i; if (cfg->files.length == 0) return git__throw(GIT_EINVALIDARGS, "Cannot get variable value; no files open in the `git_config` instance"); @@ -311,11 +312,10 @@ int git_config_get_string(git_config *cfg, const char *name, const char **out) for (i = 0; i < cfg->files.length; ++i) { internal = git_vector_get(&cfg->files, i); file = internal->file; - error = file->get(file, name, out); - if (error == GIT_SUCCESS) - break; + if ((error = file->get(file, name, out)) == GIT_SUCCESS) + return GIT_SUCCESS; } - return error; + return git__throw(error, "Config value '%s' not found", name); } |
