diff options
author | Nelson Elhage <nelhage@nelhage.com> | 2018-08-05 14:25:22 +0000 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-10-26 14:58:51 +0200 |
commit | ab3f609981cd43ed09ea4d3522738322d8e81604 (patch) | |
tree | 31d110e5909accb32758183214633874aebeac15 | |
parent | 9023f8f66a4dc03597e75a7527f603cc106c16f7 (diff) | |
download | libgit2-ab3f609981cd43ed09ea4d3522738322d8e81604.tar.gz |
Don't error on missing section, just continue
(cherry picked from commit 019409be004fb73071415750e98db03d33fada47)
-rw-r--r-- | src/config_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config_file.c b/src/config_file.c index c95ad6705..8808a161c 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -1075,12 +1075,12 @@ static int read_on_variable( GIT_UNUSED(line); GIT_UNUSED(line_len); - if (!current_section) { - giterr_set(GITERR_CONFIG, "no section for key: %s", var_name); - return -1; + if (current_section) { + git_buf_puts(&buf, current_section); + git_buf_putc(&buf, '.'); } git__strtolower(var_name); - git_buf_printf(&buf, "%s.%s", current_section, var_name); + git_buf_puts(&buf, var_name); git__free(var_name); if (git_buf_oom(&buf)) { |