diff options
author | Russell Belfer <rb@github.com> | 2013-05-23 09:19:42 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-05-23 15:57:52 -0700 |
commit | 3b32b6d3cc649a7808151dd67d1dd3e45e202f08 (patch) | |
tree | 9bc29a22b9cae9d19c4d5eef737b87e738e0d140 /src/config.c | |
parent | 9c941ccfaf600caef3c87387a6992bfe5a17c742 (diff) | |
download | libgit2-3b32b6d3cc649a7808151dd67d1dd3e45e202f08.tar.gz |
More tests of config with various absent files
Plus a bit of extra paranoia to ensure config object has valid
contents.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index dc8c7024e..49b91237d 100644 --- a/src/config.c +++ b/src/config.c @@ -465,10 +465,13 @@ static int get_string(const char **out, const git_config *cfg, const char *name) { file_internal *internal; unsigned int i; + int res; git_vector_foreach(&cfg->files, i, internal) { - int res = get_string_at_file(out, internal->file, name); + if (!internal || !internal->file || !internal->file->get) + continue; + res = get_string_at_file(out, internal->file, name); if (res != GIT_ENOTFOUND) return res; } |