Commit c4d7fa95 by Nelson Elhage

config_file: Don't crash on options without a section

parent 64138b70
......@@ -1035,6 +1035,10 @@ 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;
}
git_buf_puts(&buf, current_section);
git_buf_putc(&buf, '.');
for (c = var_name; *c; c++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment