summaryrefslogtreecommitdiff
path: root/src/submodule.c
diff options
context:
space:
mode:
authorEtienne Samson <samson.etienne@gmail.com>2018-10-24 01:21:21 +0200
committerEtienne Samson <samson.etienne@gmail.com>2019-01-04 13:33:55 +0100
commit9c23552c3806212305fe1d48f511935f9fa75bf9 (patch)
tree242c2d6d74301e6801878979d332c4245c3e8399 /src/submodule.c
parent9f714dec3ae3c5b579483428451c0daf42995a5d (diff)
downloadlibgit2-9c23552c3806212305fe1d48f511935f9fa75bf9.tar.gz
submodule: grab the error while loading from config
Previously, an error in `git_config_next` would be mistaken as a successful load, because the previous call would have succeeded. Coverity saw the subsequent check for a completed iteration as dead, so let's make it useful again. CID 1391374
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c
index f52b65876..c468a9618 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -208,7 +208,7 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
if ((error = git_config_iterator_glob_new(&iter, cfg, key)) < 0)
goto out;
- while (git_config_next(&entry, iter) == 0) {
+ while ((error = git_config_next(&entry, iter)) == 0) {
const char *fdot, *ldot;
fdot = strchr(entry->name, '.');
ldot = strrchr(entry->name, '.');