git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/1] config: a user-provided invalid section is not a BUG

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 17, 2018, 21:47 UTC
Message-ID
<7559f3e7e1e5858b0f50afd53da5aafb683b9828.1526593623.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1526593623.git.johannes.schindelin@gmx.de>

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>
---
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.c b/config.c
index 6f8f1d8c113..2392a8076b7 100644
--- a/config.c
+++ b/config.c
@@ -2359,7 +2359,7 @@ static int store_aux_event(enum config_event_t type,
 
 	if (type == CONFIG_EVENT_SECTION) {
 		if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
-			BUG("Invalid section name '%s'", cf->var.buf);
+			return error("invalid section name '%s'", cf->var.buf);
 
 		/* Is this the section we were looking for? */
 		store->is_keys_section =
-- 
2.17.0.windows.1.42.gaba71d8cd65
Previous: Johannes SchindelinNext: Junio C Hamano
Message 2 of 3 in “Hot fix for js/empty-config-section-fix”
  1. 0/1 Hot fix for js/empty-config-section-fixJohannes Schindelin, May 17, 2018
  2. 1/1 config: a user-provided invalid section is not a BUGJohannes Schindelin, May 17, 2018
  3. Junio C HamanoMay 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.