From 460a7f9615ebf4ca891a6626d158b71732e52e31 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 24 Jul 2026 00:09:54 +0200 Subject: [PATCH] conf: better handling of set In the case of --set=foo.0=bar, the 0 was not creating a sequence if ever the sequence is not existing. Ticket: 8606 --- src/conf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/conf.c b/src/conf.c index 605837c564..747e1f48f4 100644 --- a/src/conf.c +++ b/src/conf.c @@ -97,6 +97,18 @@ SCConfNode *SCConfNodeGetNodeOrCreate(SCConfNode *parent, const char *name, int node->parent = parent; node->final = final; TAILQ_INSERT_TAIL(&parent->head, node, next); + + /* Numeric-only key implies the parent is a sequence (yaml + * "- foo" produces the same shape). This lets --set style + * overrides populate list-typed config nodes. */ + if (parent != NULL) { + const char *p = key; + while (*p != '\0' && isdigit((unsigned char)*p)) + p++; + if (*p == '\0' && p != key) { + parent->is_seq = 1; + } + } } key = next; parent = node;