config: a user-provided invalid section is not a BUG
This was pointed out by Jeff King while the empty-config-section-fix patch series was cooking, and was not addressed in time for that patch series to advance to `master`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 17, 2018 at 23:47 UTC
438a87d1e25fa6715f38e30ee394d34e71d44acb
1 file changed
+1
-1
config.c
+1
-1
@@ -2329,7 +2329,7 @@ static int store_aux_event(enum config_event_t type,
2329
2330
if (type == CONFIG_EVENT_SECTION) {
2331
if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
2332
- BUG("Invalid section name '%s'", cf->var.buf);
2332
+ return error("invalid section name '%s'", cf->var.buf);
2333
2334
/* Is this the section we were looking for? */
2335
store->is_keys_section =